Score:0

openjdk-11-jre-headless installation problem on ubuntu 18.4

in flag

I am trying to install openjdk-11-jre-headless or default-jre on my ubuntu machine but no mather what I do I get some error messages while doing it.

" The following packages have unmet dependencies:
 openjdk-11-jre-headless : Depends: initscripts but it is not installable
E: Unable to correct problems, you have held broken packages " 

" The following packages have unmet dependencies:
 default-jre : Depends: default-jre-headless (= 2:1.11-68ubuntu1~18.04.1) but it is not going to be installed
               Depends: openjdk-11-jre but it is not going to be installed
E: Unable to correct problems, you have held broken packages. "

I have tried already these commands to fix the problem but no luck..

  • sudo apt-get update --fix-missing
  • sudo apt-get update
  • sudo apt-get clean
  • sudo apt-get autoremove
  • sudo dpkg reconfigure -a
  • sudo apt install -f

I tried the same thing with aptitude:

  • aptitude install default-jre but no luck...

Any ideas how to fix the " broken package " and dependency issuses?

Detailed system information

Distributor ID: Ubuntu
Description:    Ubuntu 18.04.6 LTS
Release:        18.04
Codename:       bionic

Apt-update:

- Hit:1 example/packages/live/example bionic InRelease 
- Hit:2 ee.archive.ubuntu.com/ubuntu bionic InRelease 
- Hit:3 ee.archive.ubuntu.com/ubuntu bionic-updates InRelease 
- Hit:4 ee.archive.ubuntu.com/ubuntu bionic-backports InRelease 
- Hit:5 ee.archive.ubuntu.com/ubuntu bionic-security InRelease 
- Hit:6 ppa.launchpad.net/nginx/stable/ubuntu trusty InRelease 
- Hit:7 ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty InRelease 
- Hit:8 adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic InRelease 
  • take note -example is a valid repo i chose to rename–
Reading package lists... Done Building dependency tree Reading state information... 
Done All packages are up to date.

Screenshot of apt-cache policy:

  • apt-cache policy default-jre
  • apt-cache policy default-jre-headless
  • apt-cache policy openjdk-11-jre

apt-cache-policy-results

Gryzto avatar
in flag
I also tried apt-get install -f but no luck :/
Someone avatar
my flag
Please add the output of `apt update`.
Gryzto avatar
in flag
Hit:1 http://example/packages/live/example bionic InRelease Hit:2 http://ee.archive.ubuntu.com/ubuntu bionic InRelease Hit:3 http://ee.archive.ubuntu.com/ubuntu bionic-updates InRelease Hit:4 http://ee.archive.ubuntu.com/ubuntu bionic-backports InRelease Hit:5 http://ee.archive.ubuntu.com/ubuntu bionic-security InRelease Hit:6 http://ppa.launchpad.net/nginx/stable/ubuntu trusty InRelease Hit:7 http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty InRelease Hit:8 https://adoptopenjdk.jfrog.io/adoptopenjdk/deb bionic InRelease take note - example is a valid repo i had to change
Gryzto avatar
in flag
Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date.
Someone avatar
my flag
Please use [edit] to add additional info.
Gryzto avatar
in flag
Yeah, sorry about it.
Someone avatar
my flag
Can you include `apt-cache policy` of `default-jre` and `default-jre-headless` and `openjdk-11-jre`. Use `apt-cache policy <package_name>`
Gryzto avatar
in flag
I added them to the: apt-cache-policy-results. Could not send straightforward copy paste because of the rep points needes :/
Someone avatar
my flag
Thanks for the outputs, lemme see. Can you provide the output of `sudo apt install openjdk-11-jre`.
Someone avatar
my flag
Also, the output of `sudo apt install initscripts`.
Score:1
in flag

The problem was caused:

Some the apt repositories contained outdated repositories not needed for the server and software anymore. They caused conflict.

Removing these repos from /etc/apt/sources.d/ repo.list file:

deb http://ppa.launchpad.net/nginx/stable/ubuntu trusty main deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu trusty main

After the removal the installation of default-jre and openjdk-11-headless was successful

Score:0
tf flag

Only this worked for me:

sudo rm /etc/apt/sources.list
sudo software-properties-gtk

and than apt update
sudo apt install default-jre
Score:-1
ru flag
dpkg --get-selections | grep "\<hold$

If anything comes back as held fix the hold and try the install again

Gryzto avatar
in flag
Hey. Thanks for helping. I tried to find hold packages but there were none.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.