3

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 just archive.ubuntu.com, because the US servers were unstable when I installed. I haven't had any other troubles up until now.

2 Answers 2

3

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.

5
  • When I run sudo apt-get dist-upgrade, I get 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Jan 14, 2015 at 5:37
  • proceed. Did you manage to fix it? Jan 14, 2015 at 7:58
  • I 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. Jan 15, 2015 at 1:13
  • 1
    You 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.
    – Aminda
    Nov 3, 2015 at 8:07
  • Thank you. It was a stupid mistake indeed. Edited the post. Nov 3, 2015 at 19:08
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.

2
  • Re-enabling updates fixed this issue for me May 30, 2016 at 13:54
  • This answer combined with the answer of Sachin Kamath provided the complete solution. Jan 10, 2018 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .