A memo when trying to create a java environment on ubuntu, which I rarely use at work.
By the way, the version is
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.10 (Yakkety Yak)"
...
It is 16.10 (Yakkety Yak). As of August 2018, the latest is like 18.04.1 LTS (Bionic Beaver), so it's old.
The installation of JDK and JRE itself
$ sudo apt-get install default-jdk
$ sudo apt-get install default-jre
I should be fine
$ sudo apt-get install default-jre
Loading the package list...Done
Creating a dependency tree
Reading status information...Done
~ Abbreviation ~
upgrade:0 pieces, new installation:8 deleted:0 pieces, pending:Seven.
29.27 out of 5 MB.I need to get a 6 MB archive.
An additional 110 MB of disk space will be consumed after this operation.
Do you want to continue? [Y/n] Y
ignore:1 http://jp.archive.ubuntu.com/ubuntu yakkety/main amd64 java-common all 0.57ubuntu1
error:2 http://jp.archive.ubuntu.com/ubuntu yakkety/main amd64 default-jre-headless amd64 2:1.8-57ubuntu1
404 Not Found
~ Abbreviation ~
E: http://jp.archive.ubuntu.com/ubuntu/pool/main/j/java-common/default-jre_1.8-57ubuntu1_amd64.Failed to get deb 404 Not Found
E:Unable to get some archives. apt-Do you want to get update--fix-Try it with the missing option.
I got an error like this. So, as you can see in the last message, if you try ʻapt-get update`
$ sudo apt-get update
ignore:1 http://dl.google.com/linux/chrome/deb stable InRelease
hit:2 http://dl.google.com/linux/chrome/deb stable Release
Get:3 https://download.docker.com/linux/ubuntu yakkety InRelease [29.5 kB]
~ Abbreviation ~
error:14 http://jp.archive.ubuntu.com/ubuntu yakkety Release
404 Not Found
error:15 http://jp.archive.ubuntu.com/ubuntu yakkety-updates Release
404 Not Found
error:16 http://jp.archive.ubuntu.com/ubuntu yakkety-backports Release
404 Not Found
Loading the package list...Done
E: The repository 'http://security.ubuntu.com/ubuntu yakkety-security Release' does no longer have a Release file.
N:Updates are disabled by default because updates cannot be safely made from such repositories.
N:For more information on creating repositories and customizing, apt-secure(8)See the man page.
E: The repository 'http://jp.archive.ubuntu.com/ubuntu yakkety Release' does no longer have a Release file.
N:Updates are disabled by default because updates cannot be safely made from such repositories.
N:For more information on creating repositories and customizing, apt-secure(8)See the man page.
E: The repository 'http://jp.archive.ubuntu.com/ubuntu yakkety-updates Release' does no longer have a Release file.
N:Updates are disabled by default because updates cannot be safely made from such repositories.
N:For more information on creating repositories and customizing, apt-secure(8)See the man page.
E: The repository 'http://jp.archive.ubuntu.com/ubuntu yakkety-backports Release' does no longer have a Release file.
N:Updates are disabled by default because updates cannot be safely made from such repositories.
N:For more information on creating repositories and customizing, apt-secure(8)See the man page.
This is also an error. .. .. ..
The cause seems to be that the repository of packages for older versions of ubuntu has changed. You need to change the source to old-releases.ubuntu.com instead of archive.ubuntu.com.
The source setting for apt is /etc/apt/sources.list
, so modify this.
$ sudo cp /etc/apt/sources.list /etc/apt/sources.listORG #Backup just in case
$ sudo sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
If you are using a repository on a subdomain of jp, it will be something like jp.old-release.ubuntu.com
.
It seems that such a domain doesn't exist, so delete jp.
(I opened it with vim
and replaced it).
with this
$ sudo apt-get update
$ sudo apt-get install default-jdk
$ sudo apt-get install default-jre
do it,
$ java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-0ubuntu1.16.10.2-b11)
OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
$ javac -version
javac 1.8.0_131
I was able to install it.
that's all.
Rather than installing the JDK / JRE, the error avoidance of ʻapt-get update has become the main focus. .. .. For error avoidance of ʻapt-get update
, I referred to here.
Thank you very much.
Recommended Posts