For fun, I compiled and installed gcc 4.7.2 in ~/build, which contains bin, doc, lib, include, man, share, et al. directories, all of which are added to the appropriate environment variables.

Now I want to remove it, so it can stop shadowing my v4.4.7 /usr/bin/gcc with all its associated libraries and whatnot (whatever they may be), but, of course, the GCC make files offer no uninstall target, and find ~/bin -iname "\*gcc*" turns up quite a bit.

Is my only option to set the prefix to some temporary directory, run the installation again, then use than new set of files as a guide for deleting the old ones? Or is there a better way?

This is on Springdale Linux 6.4 (Pisa), kernel 2.6.32-358.11.1.el6.x86_64, and I do not have root access.


In GCC 5.1.0, the best method so far is to install it somewhere else with DESTDIR and then use that to decide which files were generated, as mentioned at: https://stackoverflow.com/a/25304014/895245

Although there is no top-level uninstall target, some directories do have it, in particular gcc, so you can do:

cd build/gcc
sudo make uninstall

This does not remove everything that was installed, but it removes major executables like gcc, g++, cpp... contained in that directory, so it might be enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.