[JAVA] Install JDK and JRE on Ubuntu 16.10

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

Install JDK and JRE on Ubuntu 16.10
Install pyqt5 on ubuntu
Install Ruby on Ubuntu 20.04
Install Autoware on Ubuntu 18.04.5
Install Homebrew on Ubuntu 20.04
Build and install Wireshark Development Release (3.3.1) on Ubuntu
Install and switch between multiple Javas on Ubuntu
Install OpenJDK7 (JAVA) on ubuntu 14.04
Install Cybozu Office 10 on Ubuntu 20.4
Install Docker on Ubuntu Server 20.04
Install zabbix agent (5.0) on Ubuntu 18.04
Install MAV Proxy on Ubuntu 18.04
Install Arudino IDE on Ubuntu 20
Install Java on WSL Ubuntu 18.04
Install Ubuntu Desktop 20.10 on RaspberryPi4
Install Arduino IDE on Ubuntu 20.04
Install raspi-config on Ubuntu 20.04 (LTS)
Install WordPress 5.5 on Ubuntu 20.04 LTS
Install PlantUML on Intellij on Ubuntu
Install Ubuntu Server 20.04 on Btrfs
Note: Install PostgreSQL 9.5 on Ubuntu 18.04
Install rbenv with apt on ubuntu and put ruby
[Virtualization] Install VMware and build Ubuntu (20.04)
Install AWS IoT Greengrass on Ubuntu
Install ngrok on ubuntu16.04 using Vagrant
Install Java Open JDK 8 on CentOS 7
Install docker and docker-compose on ubuntu in the shortest process
How to Install Elixir and Phoenix Framework on Ubuntu 20.04 LTS
Install and configure jenv on macOS
How to install WildFly on Ubuntu 18.04
Install MQTT broker Mosquitto on Ubuntu 18.04
Enable Java 8 and Java 11 SDKs on Ubuntu
Install SonarQube on ECS instance on Ubuntu 16.04
Install ruby on Ubuntu 20.04 with rbenv
Install Java 9 on windows 10 and CentOS 7
Installing and using Ansible on Ubuntu 16.04
How to install and use Composer on an ECS instance on Ubuntu 16.04
How to install and configure the monitoring tool "Graphite" on Ubuntu
Install Ubuntu20.04 on RaspberryPi 4 and build Kubernetes to run the container
Install Ubuntu Server 20.04 in VirtualBox on Mac and connect with SSH
Install Docker on Ubuntu and set up remote connection using tls
Install docker and docker-compose on Alpine Linux
Change JDK and Tomcat versions on CentOS
Headless install of Ubuntu 20.10 on Raspberry Pi
Install OpenJDK (Java) on the latest Ubuntu
How to install production Metabase on Ubuntu
I want to install PHP 7.2 on Ubuntu 20.04.
Install Realtek network driver on Ubuntu Note
Download JDK with Gradle and make JRE
tmux on Ubuntu
Wine settings on Ubuntu 18.04 (install WOLF RPG Editor)
Install java and android-sdk on Mac using homebrew
Install Ubuntu Core 18 on Raspberry Pi 2 Model B
Publish MySQL externally and log in on Ubuntu
Install Docker on Raspberry Pi 4 and Raspberry Pi OS 64bit
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
How to install network drivers on standalone Ubuntu
Build a DHCP and NAT router on Ubuntu 16.04
How to install NVIDIA driver on Ubuntu 18.04 (Note)
Install SonarQube on Mac and challenge source analysis
How to install multiple JDKs on Ubuntu 18.04 LTS