views:

156

answers:

2

One of the things I still can't wrap my head around is rules of thumb to uninstall programs in *nix environments. Most of the time I'm happy to let the sleeping dogs lie and not uninstall software that I no longer need. But from time to time I end up with several Apaches, svn, etc.

So far here's what I know about dealing with this:

1) if you installed using apt-get or yum, there's an uninstall command. Very rarely there's an uninstall script somewhere in the app's folder, something like uninstall.sh

2) to figure out which particular install is being called from the command line use "type -a" command

3) use "sudo find / | grep" to find where else stuff might be installed (from what I understand type only looks for things that are in the PATH variable)

4) Add/change order of things in PATH to make the desireable version of the app to be first in line or add an alias to .bashrc

5) delete the stuff I no longer want. This one is easy if the application was installed only in one folder, but tricky if there are multiple. One trick that I've heard of is running a find with a time range to find all the files that changed arount the time when the install happened - that roughly shows what was changed and added.

Do you have anything to add/correct?

+6  A: 

If you didn't use a package manager (rpm, apt, etc), then you probably installed from source. To install, you performed a process along the lines of ./configure && make && make install. If the application is well-behaved, that "install" make target should be coupled with an "uninstall" target. So extract the sources again, configure again (with the same paths), and make uninstall.

Tyler McHenry
Christopher Mahan
+5  A: 

Generally, if you're compiling something from source, the procedure will be

$ make
$ su
# make install

in which case, the vast majority of programs will have an uninstall target, which will let you reverse the steps that happened during install by

$ su
# make uninstall

As always, read the program's README or INSTALL files to determine what's available. In most situations you'll either install something via a package manager (which will also handle the uninstall), or you'll have invoked some kind of manual process (which should have come with a readme explaining how to uninstall it).

Andrzej Doyle
YOu should never ever use su like that. If you want to run anything as super user use sudo
Martin York
That's a different discussion altogether. :-) Suffice to say that most INSTALL docs I've seen give "su" in the examples instead of "sudo", and while the latter might be more convenient I wouldn't say it's more secure in most environments.
Andrzej Doyle