This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to remove binary files which are installed into /usr/local/bin

How to remove binary files installed into /usr/local/bin I have installed a program with conventional processes like configure, make, and make install. I cannot remove it because their either chmod or rm command does not work. Thanks. I tried to purge the program (hmmer) with the command prompt (sudo apt-get remove hmmer ) but still not remove binary files.

file-system linux bash

If you can sudo without restrictions, you can simply delete the program from wherever it is residing. More information here: https://stackoverflow.com/a/1439989

Short: try sudo make uninstall and if that doesn't work: make -n install and reverse all the steps.

Or just delete the binary in /usr/local/bin without bothering about the rest.

1 answer

Some programs provide an uninstall or clean target in their Makefile. Try running:

cd /path/to/source/directory
sudo make uninstall

Identify the binary files that were installed. Typically, these are located in /usr/local/bin. You can use the rm command to remove them:

sudo rm /usr/local/bin/binary_file

Check for other installed files, such as libraries, headers, or documentation. Remove them manually using the rm command or by deleting the corresponding directories:

sudo rm -rf /usr/local/lib/program_name
sudo rm -rf /usr/local/include/program_name

If you removed libraries, update the shared libraries cache:

sudo ldconfig

Remove any remaining configuration files or directories:

sudo rm -rf /etc/program_name

In addition:

sudo apt autoremove
sudo apt clean

Log in to answer this question.