As you can see in the screenshot, i was told to apt-get install oracle-java8-install but it gave me an error that I don't have met dependencies of java-common. Okay, great. Now I try to install apt-get install java-common. Another error! Now I'm totally lost.

Ubuntu is at version 18.04, after so many years why is it still such a PITA to install simple stuff like this.

I am going to cry.

enter image description here

  • It looks like you're following an obsolete tutorial. Does it have to oracle jdk? Ubuntu has openjdk packages in the repository. For jdk 8 the package name is openjdk-8-jdk. Btw, openjdk is the reference implementation of java. Also there is default-jdk meta-package but I'm not sure what version of jdk it will pull, in 16.04 it's jdk 8. – aasril Sep 27 '18 at 7:01
  • I tried sudo apt install openjdk-8-jdk i get dependency error: oracle-java8-installer : Depends: java-common but it is not installable -- I then do a apt install java-common which throws error: Unable to locate package oracle-java-common – Patoshi パトシ Oct 1 '18 at 15:51
  • You need to fix/remove the broken package first. This is entirely a different problem. You can search the solution on this website or google. – aasril Oct 2 '18 at 5:57

Why is it such a PITA? The Oracle version of Java is not able to be distributed the same way as other Ubuntu packages. The best solution to this is to use the openJDK version of Java.

If you absolutely need to use Oracle Java 8, you'll need to add a PPA to your repository list:

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt update

And then install Oracle Java 8 (I'm assuming you also want it to be set as default)

$ sudo apt install oracle-java8-set-default

This should begin the installation, and you should get a prompt asking to accept the license. Use the keyboard to accept it, and it should begin downloading Oracle Java 8. You should see a progress indicator that scrolls up your screen.

It should install Oracle Java 8 update 181.

  • Doesn't work! I get hit with dependency errors again: says to install oracle-java8-installer and then that fails and ask for oracle-java-common which also fails too! "unable to locate package oracle-java-common' – Patoshi パトシ Oct 1 '18 at 15:49

My sources were all messed up it seems. Everything was commented out in this file: /etc/apt/sources.list

I pasted the following into it instead:

#                            OFFICIAL UBUNTU REPOS                             #

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse 

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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