I tried to install openjdk6 on 12.04 LTS, with the command:

sudo apt-get install openjdk-6-jre

but got the following error:

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-6-jre : Depends: openjdk-6-jre-headless (>= 6b24~pre1-1ubuntu3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Please help. Thanks!


Suggest the following

sudo apt-get clean


sudo apt-get update


sudo apt-get install openjdk-6-jre

From the man page: " clean clears out the local repository of retrieved package files. It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/."

If this doesn't solve your problem, please post the contents of /etc/apt/sources.list

(EDIT): Your sources.list looks fine. Try sudo apt-get install -f && apt-get install openjdk-6-jre . The -f flag to apt-get install stands for 'Fix', i.e. attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to deduce a likely solution.

| improve this answer | |
  • Thanks for the advice. I tried it and still no luck. The following are the contents of my /etc/apt/sources.list file, appreciate any advice: dl.dropbox.com/u/98416047/sources.list – Lost Dec 15 '12 at 9:09
  • See updated answer above. – Clive van Hilten Dec 15 '12 at 12:50
  • Thanks Clive. I found out that the mirror (biruni.upm.my/mirror/ubuntu) I was using is somehow weird, so I changed to another one, and everything was OK again. I will remember the -f flag though, could come in handy. – Lost Dec 16 '12 at 1:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.