5

I had to rebuild a docker container this past week, and as part of a 16.04 container creation, it does an apt-get install openjdk-8-jdk which fails with a 404 error.

Switching to apt-get install default-jdk tries to pull the same package and, likewise, fails with a 404 error. See below. As is normal practice, I run apt-get update before trying this.

Get:168 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxi6 amd64 2:1.7.6-1 [28.6 kB]
Get:169 http://archive.ubuntu.com/ubuntu xenial/main amd64 libxrender1 amd64 1:0.9.9-0ubuntu1 [18.5 kB]
Err:170 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openjdk-8-jre-headless amd64 8u151-b12-0ubuntu0.16.04.2
  404  Not Found [IP: 91.189.88.162 80]
Get:171 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 ca-certificates-java all 20160321ubuntu1 [12.5 kB]
Err:170 http://security.ubuntu.com/ubuntu xenial-security/main amd64 openjdk-8-jre-headless amd64 8u151-b12-0ubuntu0.16.04.2
  404  Not Found [IP: 91.189.88.162 80]

Did the 16.04 repos get all wonky all of a sudden?

Thanks much!

Byte Commander
  • 107,489
Eric63
  • 91
  • Try sudo apt-get update before installation again. – N0rbert Apr 09 '18 at 16:01
  • I had the same problem on 17.10. I gave up trying to install JDK8 and just installed JDK9 which seems to be available on 16.04 repos as well. – Jesus H Apr 09 '18 at 16:38
  • Yes, did the apt-get update as a matter of course, and noted in the above posting. The docker container is supposed to live long after the package is done and is being set-up per vendor recommendation. – Eric63 Apr 09 '18 at 16:51
  • Not working on ubuntu:bionic even after apt-get update Error: E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/universe/o/openjdk-8/openjdk-8-jre-headless_8u222-b10-1ubuntu1~18.04.1_amd64.deb Connection failed [IP: 91.189.88.31 80] – Nitin Nov 25 '19 at 06:16

3 Answers3

7

Did you do sudo apt-get update recently? If not, do that, then try again.

The 404 error is that it's hunting a specific version of the package that is not available on the repos anymore, and this usually happens when your repository 'state' information is out of date. Usually a call to sudo apt-get update will fix that problem, and then you can retry the sudo apt-get install command you were trying to run again.

Thomas Ward
  • 74,764
  • Did that as a matter of course. Note that trying to install metapackage "default-jdk" ends up with the same result. – Eric63 Apr 09 '18 at 16:49
0

Thomas, the repos have been fixed. Rerunning sudo apt-get update now -- I mean, after Thursday, 4/12/2018, resolves the issue.

Thanks much!

Eric63
  • 91
0

I'm on WSL2 and following these instructions was required to complete the installation.

Apparently the WSL instance was not time-synced with the real host time, causing problems with apt-get update && install.

funder7
  • 196