0

Before someone comes and marks this as a duplicate I would like to mention that I have seen 10 similar problems and I have followed all of the steps but with no use. I followed

and with no exaggeration 7 more but non worked.

I simply want to install the 8th version of JDK and JRE. After following a bunch of steps here is where I’m at I added the repository and I run this command apt-get install oracle-java8-installer and I get this message:

The following packages have unmet dependencies:
oracle-java8-installer : Depends: java-common (>= 0.24) but it is not installable
Recommends: gsfonts-x11 but it is not going to be installed
Recommends: oracle-java8-set-default but it is not going to be installed

Afterwards I tried to install java-common using apt-get install java-common but I get this message:

Package java-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
java-policy

E: Package 'java-common' has no installation candidate

Its important to note that I currently have no Java packages installed (I can't use the java command) and I have added add-apt-repository ppa:webupd8team/java successfully.

This is my distribution's info:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"

I know this has been asked a lot but I have spent the last 4 hours trying to figure it out through other questions but to no avail.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
Omar Alama
  • 1
  • 1
  • 1
  • 16.04.2 means you're missing lots of system updates. Please fully update your system before attempting to install new software: sudo apt update && sudo apt full-upgrade. –  Nov 04 '17 at 19:20
  • I just used those commands and i got 0 changes. the dist info stayed the same too :/ – Omar Alama Nov 04 '17 at 19:22
  • And did it installed updates? If not you have other problems. –  Nov 04 '17 at 19:34
  • 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. – Omar Alama Nov 04 '17 at 19:45
  • Could you please [edit] your question to include the output of apt-cache policy oracle-java8-installer? Thanks. – David Foerster Feb 17 '18 at 17:10

2 Answers2

2

In my case I just selected all radio buttons in

Software&Updates -> Ubuntu Software -> Downloadable from the internet

and install it with

sudo apt-get install oracle-java8-installer
zx485
  • 2,426
Ivan M
  • 21
  • 2
-1

I had exactly the same problem. As MichaelBay said "And did it installed updates? If not you have other problems." So it turned out I have deleted "/etc/apt/sources.list". And later on it was recreated with empty content. I found my fix here: Ubuntu fix dependency problems

  • 1
    If your answer is essentially a referral to another question, it would be better to flag this question as a duplicate of the other once you earned 15 reputation. If you have the reputation don't forget to vote for the answer(s) there that you found useful! – David Foerster Feb 17 '18 at 17:05
  • Thanks for the advice, David. This is essentially my very first answer. I have no reputation what so ever and I am a complete noob with Linux. After searching for hours and executing blindly apt-get update, apt-get upgrade, apt-get install oracle-java8-installer without anything happening, I found the dependency problem and felt like shearing it here. Cheers! – Alexander Kitov Feb 18 '18 at 18:13
  • In that case welcome to Ask Ubuntu and thanks for you contribution! I certainly don't blame you for your beginner's mistake since the Q&A model of Ask Ubuntu (and Stack Exchange in general) is a little different from what most people seem used to. Maybe you'd like to take the tour to learn more about it. We're looking forward to your future and (hopefully) high quality contributions! – David Foerster Feb 18 '18 at 19:09