I don't want OpenJDK installed on my Ubuntu 13.04 system, but trying to uninstall the openjdk-7-jre yields the following message.

$ sudo apt-get purge openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre gcj-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm libgcj-common libgcj13 libgcj13-awt
  openjdk-6-jre-headless openjdk-6-jre-lib
Suggested packages:
  fastjar gcj-4.7-jdk gcj-jdk libgcj13-dbg sun-java6-fonts fonts-ipafont-gothic fonts-ipafont-mincho ttf-telugu-fonts ttf-oriya-fonts ttf-kannada-fonts
  ttf-bengali-fonts
The following packages will be REMOVED:
  default-jre* icedtea-7-plugin* icedtea-netx* icedtea-plugin* libatk-wrapper-java* libatk-wrapper-java-jni* openjdk-7-jre*
The following NEW packages will be installed:
  gcj-4.7-base gcj-4.7-jre gcj-4.7-jre-headless gcj-4.7-jre-lib gcj-jre gcj-jre-headless icedtea-6-jre-cacao icedtea-6-jre-jamvm libgcj-common libgcj13 libgcj13-awt
  openjdk-6-jre-headless openjdk-6-jre-lib
0 upgraded, 13 newly installed, 7 to remove and 4 not upgraded.
Need to get 57,0 MB/57,2 MB of archives.
After this operation, 156 MB of additional disk space will be used.
Do you want to continue [Y/n]?

What do I need to do so that no new packages, of which I need none, will be installed when removing openjdk-7 ?

Best Answer


Great question i was always wondering this

I found that you can use the following to remove the openjdk-7-jre on Ubuntu 13.04.

sudo apt-get autoremove openjdk-7-jre

Press 'y' and then press enter when prompted to confirm this change. This should also clean up all the additional dependency libraries that were installed with it

I also found you can use the following command to perform a additional cleanup

sudo apt-get purge openjdk*

If you use the following command

java -version

You should no longer see the openjdk-7-jre installed

I hope this helps :)