Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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!

share|improve this question

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.

share|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: – 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 ( 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 posting your answer, you agree to the privacy policy and terms of service.

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