Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze2)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)

There doesn't seem to be an easy way to search for packages in apt so I'm using dpkg to search for java-related packages:

# dpkg --get-selections | less | grep java
ca-certificates-java            install
java-common                     install
javascript-common               install
libaccess-bridge-java           install
libaccess-bridge-java-jni       install
libdb4.7-java-gcj               deinstall
libhsqldb-java-gcj              deinstall
sun-java6-bin                   deinstall
sun-java6-jre                   deinstall
tzdata-java                     install

I proceed to remove java-common, however when it finishes java is still installed and java -version still shows the same thing.

Nothing changes, the java-common package even still appears in the dpkg search. What am I missing?

I also removed OpenJDK, which seemed to set it to "deinstall":

# dpkg --get-selections | less | grep openjdk
openjdk-6-jre                   deinstall
openjdk-6-jre-headless          install
openjdk-6-jre-lib               install

Java is still there.

# java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.13) (6b18-1.8.13-0+squeeze2)
OpenJDK 64-Bit Server VM (build 14.0-b16, mixed mode)
share|improve this question
How exactly did you remove the packages? Because deinstall just means that it is selected for deinstallation, but not actually deinstalled. – Jan Hlavacek Jun 16 '13 at 3:06
Also, there is something strange about the order in your pipes: do you have any reason for having less before grep? – Jan Hlavacek Jun 16 '13 at 3:07
I used apt-cache remove <package> to remove them, and they showed up as "deinstall" in dpkg -- not sure if that's normal. – some1 Jun 16 '13 at 8:01
There was too much output and I tried less before I grepped. ;p You're right it makes no sense as is. – some1 Jun 16 '13 at 8:02
Are you sure you used apt-cache? As far as I know apt-cache does not even have a remove command, anyway, apt-cache is for querying the apt cache, not for installing and unistalling packages. Using apt-get remove <package>, or apt-get purge <package> would be better. I myself use aptitude for tasks like that, it has nice user interface, or if you want something with a GUI, synaptic is supposed to be good. – Jan Hlavacek Jun 16 '13 at 14:22

For me it was:

sudo apt-get remove openjdk-6*
sudo apt-get remove icedtea*
share|improve this answer

Have you tried:

  1. sudo apt-get remove '*jre*'
  2. sudo apt-get remove '*icedtea*'

These are just regex's that should match anything with "icedtea" or "jre" in the name.
Hope this helps!

share|improve this answer
I doubt that will work, at least when called from shell. The shell will interpret the asterisks as shell globs, and try to expand them. Depending on your setting, most likely it will try to expand them into a list of all files in the working directory that have the string jre (or icedtea) in their filename. Even if there are such files, it is very unlikely that their filenames will be exactly the names of the packages you want to remove. – Jan Hlavacek Jun 16 '13 at 3:15
@JanHlavacek Oops. I will fix it. These commands work when called from an empty directory! ;) – BenjiWiebe Jun 17 '13 at 13:20
@JanHlavacek They should work correctly now. – BenjiWiebe Jun 17 '13 at 13:20
That depends on your shell, and perhaps on your specific setting. When I try to run them from an empty directory, the shell complains that it cannot find any match, and cannot therefore expand the glob. Another problem is that you are relying on the fact that there is no other completely unrelated package that has, by chance, the string jre in its name. While that seems to be the case in the current Debian repos, it may not be the best idea to rely on it, in the case someone packages the (fictional) program jrecode which converts between differet japanese character sets. – Jan Hlavacek Jun 17 '13 at 21:43
I mean the original ones. The quoted ones work, but still see my other point. – Jan Hlavacek Jun 17 '13 at 21:44

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.