sudo apt install openjdk-11-jre-headless
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 openjdk-11-jdk : Depends: openjdk-11-jre (= 11~24-1~18.04)
                  Depends: openjdk-11-jdk-headless (= 11~24-1~18.04)
 openjdk-11-jre-headless : Conflicts: oracle-java11-installer but 11.0.1-2~linuxuprising1 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Please help how to resolve



sudo apt --fix-broken install

if above command does not help then try to install oracle JDK with following steps.

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer

To setup the environment variable

sudo apt-get install oracle-java8-set-default

then check whether JDK installed properly.


Please can you try and see which jdk will install with this:

sudo apt install default-jre

If you don't like the version don't install it. The last time I test it It was build of java 10.0.2 but it was compatible with java 11 (I dont remeber clearly). Nevertheless in the future it will be changes to java 11.

Check here for more info: Why is OpenJDK 10 packaged as openjdk-11-*?

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.