Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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'm using ubuntu 10.10 and recently my package manager has stopped working because of some problems with dependencies or something. I can't upgrade, install or uninstall anything at all. This is a huge problem. I couldn't find a solution to this with google so I'm asking here for help.

This is what apt-get -f install outputs

LANG=en_US.UTF-8 sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up openjdk-6-jre-headless (6b20-1.9.5-0ubuntu1) ...
update-alternatives: error: alternative path /usr/lib/jvm/java-6-openjdk/jre/bin/java doesn't exist.
dpkg: error processing openjdk-6-jre-headless (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)
share|improve this question
up vote 4 down vote accepted

I'd just reinstall the package...

sudo mv /var/lib/dpkg/info/openjdk-6-jre-headless.postinst /var/lib/dpkg/info/openjdk-6-jre-headless.postinst.bad
sudo apt-get --reinstall install openjdk-6-jre-headless
share|improve this answer
After all it was that easy. Thank you and thousand internets to you. :D – lukad Feb 14 '11 at 21:24
"...thousand internets to you." - huh, do you want all spam on the internet to be send to him? :P I've never heard of this saying. – Lekensteyn Feb 14 '11 at 21:32
Feel free to rank up arrange's answer (you've already marked it answered). – Scaine Feb 14 '11 at 21:33

Looks like you've got a broken Java installation.

Try sudo apt-get purge openjdk-jre.

Then I'd recommend ticking the "Partners" repository in synaptic, reloading and installing Sun's JRE with sudo apt-get install sun-java6-jre.

share|improve this answer
See my initial post. This is what I did. But i'll try to roughly translate it. – lukad Feb 14 '11 at 20:59
Don't translate it, just run it using LANG=en_US.UTF-8 sudo apt-get install -f. – arrange Feb 14 '11 at 21:03
Oh haha too late. But thanks. – lukad Feb 14 '11 at 21:04
Everything I do that is either purge, install, upgrade or remove gives me the same error. I can't do anything. It makes the package manager useless. – lukad Feb 14 '11 at 21:18

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.