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

For security reasons I want to remove/uninstall all instances of Java from my computer and prevent it from being installed again. On Windows computers I would simply just not install the software found at this webpage:

But on Ubuntu I've noticed that Java seems to have gotten installed on my system without my explicitly doing it and it shows in several ways, e.g., through plugins, etc.

What Java software on ubuntu is the equivalent of having installed the software at on Windows? Will uninstalling one "Java-named app" uninstall everything Java related on my computer?

How do I blacklist Java so that it isn't installed again?

share|improve this question
Why would you want to? – Alvar Sep 4 '11 at 19:57
? I said why I want to in the post. – Chad--24216 Sep 4 '11 at 21:03
That's a bit paranoid, especially given that java isn't installed by default. – mikewhatever Sep 4 '11 at 23:03
How did it get installed then on my system? I did a fresh install of 11.10 beta 1. I did not purposely install Java. Nor did I install the restricted extras package. I would like to completely uninstall all Java. Java has extremely poor security record. This is hardly "paranoid." – Chad--24216 Sep 5 '11 at 0:57
Install 11.04 and you wont get Java. Then remove Java from the whitelist so it's harder to install it again. That should do what you want, what Java version do you have? :) – Alvar Sep 5 '11 at 21:35

Fistly, I also think totally banning Java is a bit paranoid :)

Secondly, you can achieve what you want by removing Java packages from the system - this will also un-install all the programs which depend on it. Something like

sudo apt-get remove java-common

then you'll need to make it non-installable, so it won't ever be installed as a dependency of another program (which will make the packages which depend on it non-inslallable too). My google-fu says that you can achieve this by editing /etc/apt/preferences and adding something like

Package: java-common
Pin: release a=fakerepo
Pin-Priority: 1001

The "fakerepo" thing makes apt to look for the package in a wrong place which prevents its installation. For more details see

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.