0

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!

1 Answer 1

1

Suggest the following

sudo apt-get clean

then

sudo apt-get update

then

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.

3
  • 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, 2012 at 9:09
  • See updated answer above. Dec 15, 2012 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, 2012 at 1:47

You must log in to answer this question.

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