When I build a program from source (CentOS), How do I go about updating it to a new version? Can I just run the make && make install again with the same configure options?
This is where GNU Stow can be useful. I've been using this tool for years to keep my OS clean. This is a package manager for programs installed from source. Here's how it works. First, I have one single directory where I keep all such programs,
/usr/local/stow. Inside it, there are directories for each program. When I compile programs from source, I use option
make install is done, the executable files are installed under
/usr/local/stow/program-name/bin, libraries are found in
/usr/local/stow/program-name/lib, etc. Then I run
cd /usr/local/stow and
sudo stow program-name. The last command creates links from
/usr/local/bin/, from lib to
/usr/local/lib, etc. So, all files that belong to one program are located in one directory.
When I want to delete or update the program, I run
sudo stow -D program-name to delete the links and remove the directory. Now, the system is clean and I can install the new version.