This Friday I saw that I had 2 held back packages for some reason when I ran apt-get upgrade
, so naturally I did what any inexperienced sysadmin would do and uninstalled the packages in the hopes that I could simply re-install them and the problem would be solved.
Little did I know, I just made the situation worse. When I tried to reinstall openjdk-8-jre-headless
, I got this:
$ apt-get install openjdk-8-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-8-jre-headless : Depends: ca-certificates-java but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I tried to upgrade the mentioned package manually, but to no avail.
$ apt-get upgrade ca-certificates-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... ca-certificates-java is already the newest version.
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Looking around I saw no mention of a solution to this exact error anywhere.
I use ElasticSearch on the server, which I restarted, but I should've expected that it wouldn't start up at this point. So now I'm without Java and my users are without search. What is going on and how can I fix this?
This worked for me:
REF: https://unix.stackexchange.com/questions/342403/openjdk-8-jre-headless-depends-ca-certificates-java-but-it-is-not-going-to-be
First you need to add
jessie-backports
repo.install commands
switch to new java
Reference: https://github.com/OpenTreeOfLife/germinator/wiki/Debian-upgrade-notes:-jessie-and-openjdk-8
I had this problem on Debian Buster, which also doesn't have this package. Since none of the answers on this page worked for me, and the accepted answer led me to another SE answer which I also could not get to work, I just wanted to post what did work for me on Buster.
Following the instructions on the debian website, I added the following line to
/etc/apt/sources.list
:deb http://security.debian.org/debian-security stretch/updates main
I was then able to
sudo apt update
andsudo apt install openjdk-8-jre-headless
.this works for me
guide