Question

Java install fails - missing java-common

When I tries to install openjdk-17-jre-headless, I got:

root@dewdrop:~# apt install openjdk-17-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openjdk-17-jre-headless : Depends: ca-certificates-java (>= 20190405~) but it is not installable
                           Depends: java-common (>= 0.28) but it is not installable
                           Depends: libnss3 (>= 2:3.17.1) but it is not going to be installed
                           Depends: libpcsclite1 (>= 1.3.0) but it is not installable
E: Unable to correct problems, you have held broken packages.

Any suggestions?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @rossboulet,

This should not happen in normal usage, have you installed something previously? Try to remove the packages that you have as dependence, update the system and try again.

Additionally, make sure you have the proper repository to install them from.

One last suggestion, create a snapshot before actually running the commands (removing packages).

Hi @rossboulet,

Sometimes, depending on SO, OpenJDK JRE 17 can show incompatibility issues, especially with dependencies.

Alternatively, you can try with:

$ sudo apt install default-jre

To check if OpenJDK JRE was properly installed:

$ java -version

Another option would be to try with Oracle OpenJDK JRE 17, check out this link.

Hope helps you - Sergio Turpín

Better formatting of the error messages here:

root@dewdrop:~# apt install openjdk-17-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 openjdk-17-jre-headless : Depends: ca-certificates-java (>= 20190405~) but it is not installable
                           Depends: java-common (>= 0.28) but it is not installable
                           Depends: libnss3 (>= 2:3.17.1) but it is not going to be installed
                           Depends: libpcsclite1 (>= 1.3.0) but it is not installable
E: Unable to correct problems, you have held broken packages.