Today, I downloaded the latest java jre which is a .bin file

By mistake, I installed it on my desktop by running ./jre. I want to remove this installation, move the .bin file to somewhere else and install it again

I tried sudo apt-get remove --purge jre gives

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Virtual packages like 'jre' can't be removed
0 upgraded, 0 newly installed, 0 to remove and 19 not upgraded.

Note: I can't use synaptic package manager, here's why, so I have to do everything from the terminal until the problem gets fixed.

The folder where the JRE is located is called jre.

Edit: @stew

just installed java jre

sudo echo 'deb http://www.duinsoft.nl/pkg debs all' >> /etc/apt/sources.list
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB26B26
sudo apt-get update
sudo apt-get install update-sun-jre

it's the latest version. so i just have now to remove the .bin file and the extracted jre folder, would your method still works?

Why to use open jdk over jre?

2 Answers 2


I would first off discourage you from not using one of the java packages provided by mint unless you really need the oracle java instead of openjdk.

I'd recommend you install your java .bin file before removing the packaged versions of java. After it is installed, you should use the equivs package in order to create a dummy .deb file you can install which will tell your package manager that you have a java-runtime. This dummy package should declare it Provides the following packages: java-runtime, java2-runtime, java5-runtime, java6-runtime java-compiler java-sdk java2-sdk java5-sdk java6-sdk and if it is java 7, then also java7-runtime java7-sdk. By doing this, you will be able to still install packages depending on a java runtime using apt-get/aptitude/synaptic/whatever.

Find help on equivs here and here

Then you can remove all of the various -jre (such as openjdk-7-jre) packages will declare Provides: java-runtime, and all the various -jdk packages will declare Provides java-compiler, so you can get rid of all these packaged versions with:

aptitude remove '~Pjava-runtime' '~Pjava-compiler'
  • please read my edit
    – Lynob
    Feb 18, 2012 at 0:00
  • issue fixed i guess, when i installed java, i then was able to delete the .bin file :)
    – Lynob
    Feb 18, 2012 at 9:37

A quick test with the .bin file obtained from http://jdk6.java.net/download.html shows that it unpacks to a new directory jre1.6.0_32 (this might vary) current directory; hence, removing the directory should work.

As for apt-get not being able to remove it, because you installed from the .bin file, the install is not tracked by the package management system (apt/dpkg), thus apt-get will not solve your problem.

Finally, software installed from .bin files or from sources other than the package management system is put in /opt. This is not a standard set in stone, but is what the FHS proposes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .