Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

and could you please tell me why to use open jdk over jre sir?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

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'
share|improve this answer
please read my edit –  Someone Like You Feb 18 '12 at 0:00
issue fixed i guess, when i installed java, i then was able to delete the .bin file :) –  Someone Like You Feb 18 '12 at 9:37
add comment

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.

share|improve this answer
add comment

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.