I installed a library, compiled from source, via make install into /usr/local/ Now I found out that that was a bad idea (conflicting files etc.) and would like to reverse that action. The package does not provide make uninstall. Is that possible, without reinstalling the whole OS? Currently running OS Tumbleweed.

  • I don't think any OSes keep a record of what you installed exactly in combination what a 'undo' possibility when compiling from source, so your best bet is to check which files the make install script installs and removing them manually. – rien333 Jul 9 '17 at 21:08

Yes, there's a few ways (which may be more complicated if your OS uses /usr/local for its own purposes (e.g. the *BSDs do use /usr/local as a destination for their packages or port) and your install has actually clobbered vendor-provided files instead of superseding vendor files under /usr...)

  • Dig around under /usr/local for files with more-or-less the same modification time as a known file installed by the library.
  • re-run the make install under something that records what files are being molested, e.g. strace -o installlog -e trace=file -ff make install

Found files could then be moved aside (most likely those under the lib bin and include directories); if your make install has changed or replaced any vendor-provided files, you may then need to reinstall specific packages to restore those originals.

(Learning how to use a software depot outside of the vendor-managed space e.g. under your home directory might be beneficial if you'll be installing lots of custom versions of software.)


Does your software use autotools? If so, you could set your installation to go somewhere else than a standard target location, e.g.

./configure --prefix=/somewhere/else/than/usr/local

For best results, use a directory that was created for the purpose that is initially empty. That would show you all the files which you have installed, and you could go through the list and remove the corresponding files from inside /usr/local. If there are a lot of these files, this process could be automated by scripting.

If not, you can still do probably do a similar thing with the software Makefile, as long as the destination is not hard coded.

autotools normally makes a make uninstall available, so it seems likely your software does not use autotools.

In general local installs can be problematic, in part for the reasons you have discovered - local installs can be hard to keep track of and can overwrite existing files. Always look for a binary package for your operating system or distribution. Doing a local install should be considered a last resort. And for simple software, generating a binary package is not hard; and there are tools that can help you do so.

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.