Everytime I try to install java on Ubuntu 18.04 (on a VirtualBox VM) with the following command (I've tried several other commands/methods from other topics/forums):

sudo apt install default-jdk

No matter what I do, when the time comes to retrieve headers, I get the following error:

Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Err:2 http://au.archive.ubuntu.com/ubuntu bionic InRelease
 Connection failed [IP: 80]
Err:3 http://au.archive.ubuntu.com/ubuntu bionic InRelease
 Connection failed [IP: 80]
Err:4 http://au.archive.ubuntu.com/ubuntu bionic InRelease
 Connection failed [IP: 80]
Reading package lists... Done
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic/InRelease
 Connection failed [IP: 80]
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease
 Connection failed [IP: 80]
W: Failed to fetch http://au.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease
 Connection failed [IP: 80]
W: Some index files failed to download. They have been ignored, or old ones used instead

It seems that isn't possible to connect to these repositories, or they are not available anymore.

Sorry, but, just to check. Do you have access to the Internet in this VirtualBox OS? Then, look up how to change the repository source for Ubuntu 18.04.

I didn't answer precisely because I haven't used Ubuntu in a long time, but I found this:



| improve this answer | |
  • Hi, thank you for your answer. I do have internet access, and I'll look into changing the repository. I did, however, try a different source and got the same error so maybe I got unlucky twice? – Milad Dakka Sep 5 '19 at 18:26
  • @MiladDakka, do you saw "Enabling Canonical Partner Repositories" on the first link? Because I found on my search this statement: 'Since Ubuntu 10.4 the sun-java* packages have moved from the "Multiverse Repository" to the "Partner Repositories"'. Maybe you need adjust this specific setting, not the main repositories. – Leandro Arruda Sep 5 '19 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.