How to update packages compiled from source? [duplicate]
Solution 1:
When you install from source, there is nothing (like dpkg) that will track the newly installed files for you (what files and where they were placed). Unless you explicitly use a tool.
How to know where the files were installed
I use Git to track installations in my /usr/local. Here is how it looks:
cd /usr/local
git init
git add .
git commit -m "Starting to track /usr/local"
Install new software (./configure
, make
, make install
). And then:
cd /usr/local
git status
git add .
git commit -a -m "Installed open-magic-1.2.3"
Now you call see what files were installed and when:
cd /usr/local
git log --stat
If you are skillful with Git you can even do uninstalls with a few git commands. But be careful as Git does not track the file permissions (I wrote a special script that can save and restore all permission and ownerships to/from a files). I only did uninstalls a couple of times, even though I have 334 commits (e.i. installed) in my /usr/local.
Some people install software into dedicated directories and make symlinks or add the bin directories to PATH.
I started doing that too. I install sources with PREFIX set to /opt/open-science-1.2.3
(for example) and then make symbolic links to the bin files in my Git tracked /usr/local/bin
. What's really nice about that is I can pre-create the /opt/open-science-1.2.3
directory owned by non-root and then run make install
as non-root. This proves to me that the install script did not wire files anywhere in the system expect into /opt/open-science-1.2.3
.
The simple but messy way
Probably the easiest way to upgrade is to just re-install the new sources. Just do the installation procedure all over as if it is the first time. You may end up having some orphaned older files lying around. The software will run correctly but the orphaned files take up space make your setup messy.