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 have been trying to uninstall jre6 but I keep getting the error
dpkg: warning: there's no installed package matching sun-java6-jre:amd64
I've tried
sudo apt-get --purge remove sun-java6\* vim
sudo apt-get purge sun-java6-\* I just want to remove it so I can install JDK7.

share|improve this question

First off, I believe the uninstall is failing because you don't have the package name exactly right. You do not need to uninstall the old version as there is a way for you to choose which you would prefer to use. Enter this command in terminal:

sudo update-alternatives --config java

The versions of Java currently installed on your system will appear for you to choose from. Keeping both can come in handy as some applications may work better with one or the other. After you have made your choice, enter this command in terminal:

java -version

That will tell you which version is currently in use to confirm your changes

share|improve this answer
I actually used sudo dpkg -P sun-java6-jre and it worked. – Austin Broussard Aug 21 '12 at 6:41
That's good, that you found a solution. I believe you can you can/ should make an answer out of that and accept it. – matt davis Aug 21 '12 at 13:49

If you ever get a dpkg error. Use the following to purge to dpkg (this is an extreme measure)
sudo dpkg -P sun-java6-jre
This should delete all remnants of sun-java6-jre .

share|improve this answer

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.