We have a stable Linux setup, and find ourselves wanting to install/upgrade additional packages for testing purposes. We want to keep the system as clean as possible with minimal side effects, to allow for the usual upgrade path to work correctly. Of course, the usual answer is to use /usr/local, but that just means we have reduced the potential tangle somewhat, and moved it to a different place, i.e. no package management under /usr/local.

Enter stow

Stow is designed to solve this problem. We install the package to /usr/local/stow/package-version and stow will manage symlinks in /usr/local, so installing/uninstalling becomes very straightforward.


Install to /tmp/testPackage-version just incase of a miss-behaved installation procedure/side effects. This way if it tries to write elsewhere it will error out and we can investigate.

$ cd testPackage
[testPackage] $ ./ --prefix=/tmp/package-version
[testPackage] $ ./configure; make; make install

If everything succeeded, we can proceed.

[testProject] $ cd /usr/local/stow
[/usr/local/stow] $ sudo mv /tmp/testPackage-version .
[/usr/local/stow] $ sudo stow testPackage-version

At this point, the package is installed and ready for use.

To remove

[/usr/local/stow] $ sudo stow -D testPackage-version

Be careful of installing multiple versions at the same time, it is safer to remove older version using stow -D then installing the newer version.