OpenJDK-7-JRE throws "broken packages" error (14.04 LTS)
Solution 1
Go to Ubuntu Software Center and search for the package software-properties-common, install that package if it is not installed.
Open your dash by pressing the Super Key (Windows Key) and type software sources. Go into the application that appears and place a check mark on all the packages present there.
After doing it, execute the following commands one by one, in a terminal window ( Ctrl+Alt+T ) :
sudo apt-get update && sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get autoremove
sudo apt-get autoclean
and then run,
sudo apt-get install default-jre
to install the package.
Solution 2
I had a hunch that the problem may have been caused by me using archive.ubuntu.com
instead of us.archive.ubuntu.com
. Sure enough, upon restoring the old sources.list file, the problem has been solved.
Thanks for the help!
EDIT
Turns out it was not caused by using the wrong server for archive.ubuntu.com
, but actually a problem with not having the update repositories enabled. tzdata
needed to be updated in order for JRE to work.
I had to go in through the Software & Updates application and enable updates on the Updates tab. After that, I'm able to install JRE.
Thanks again for the help. I can finally put this problem to bed.
Related videos on Youtube
ExplodingKittens
Updated on September 18, 2022Comments
-
ExplodingKittens over 1 year
I have an application that requires the Java JRE. I decided to go ahead and install the JRE from the repositories. Normally, the only issue I would have with this is it taking forever and a day to download. However, this time, I get this...
ben@ben-Aspire-5250:~$ sudo apt-get install default-jre 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: default-jre : Depends: default-jre-headless (= 2:1.7-51) but it is not going to be installed Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
When trying to install openjdk-7-jre-headless directly, I get this:
ben@ben-Aspire-5250:~$ sudo apt-get install openjdk-7-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-7-jre-headless : Depends: tzdata-java but it is not going to be installed Depends: libnss3-1d (>= 3.12.9+ckbi-1.82-0ubuntu4) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
I looked in Synaptic and tried to "fix broken packages", but Synaptic found nothing to do. When I try
sudo apt-get -f install
, I just get:Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
What could be going wrong here?
It's worth noting that I changed all instances of
us.archive.ubuntu.com
to justarchive.ubuntu.com
, because the US servers were unstable when I installed. I haven't had any other troubles up until now. -
ExplodingKittens over 9 yearsWhen I run
sudo apt-get dist-upgrade
, I get0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
-
Sachin S Kamath over 9 yearsproceed. Did you manage to fix it?
-
ExplodingKittens over 9 yearsI have since managed to resolve the issue, as I said in the answer I posted. I had disabled the update repositories, so tzdata couldn't find the newer version it needed, and that resulted in a broken packages error. I re-enabled the update repositories and was able to install JRE without trouble.
-
Mikaela over 8 yearsYou should run
sudo apt-get update
before upgrade or dist-upgrade so apt checks if there are new packages in the repository. It makes no sense to me to run it after those two. -
Sachin S Kamath over 8 yearsThank you. It was a stupid mistake indeed. Edited the post.
-
Shane Gannon almost 8 yearsRe-enabling updates fixed this issue for me
-
Mohit Mittal over 6 yearsThis answer combined with the answer of Sachin Kamath provided the complete solution.