To clarify; what (x) stow does, is manage a set of symlinks from/in eg: /usr or /usr/local to a similar tree under eg: /usr/local/<program-version/, so that for instance:
/usr/local/bin/<program> -> /usr/local/<program-version>/bin/<program>
Similarly for man, lib etc. If you don't put stuff under /usr or /usr/local (but, say under /opt or ${HOME}/opt) -- you need to update your paths (PATH, MANPATH, USER_LD..).
Uninstalling just means removing the symlinks (unstow) and deleting the tree under /wherever/<program-version>.
This is what I do in my bashrc (which I use across a range of systems, some of which are mine, some of which I only have a user accounts -- some on Solaris, most on a flavour of Linux):
# set PATH so it includes user's private bin if it exists
for dir in "${HOME}" "${HOME}/opt" "${HOME}/opt/${unps}"
do
if [ -d "${dir}/bin" ]
then
PATH="$dir/bin":"${PATH}"
fi
# For python binaries, in "default" virtenv:
if [ -d "${dir}/pybin" ]
then
PATH="$dir/pybin":"${PATH}"
fi
# do the same with MANPATH
if [ -d "${dir}/man" ]
then
MANPATH="${dir}/man":"${MANPATH}"
fi
if [ -d "${dir}/lib" ]
then
USER_LD_LIBRARY_PATH="${dir}/lib":"${USER_LD_LIBRARY_PATH}"
fi
if [ -d "${dir}/include" ]
then
USER_LD_RUN_PATH="${dir}/include":"${USER_LD_RUN_PATH}"
fi
done
#Then later:
export PATH MANPATH USER_LD_LIBRARY_PATH USER_LD_RUN_PATH
The part about "pybin" is just becaus I do:
cd ~/opt
mkdir python-venvs
virtualenv --no-site-packages python-venvs/misc
ln -s python-venvs/misc/bin pybin
And can then pip install stuff and have it available without having to worry about activating a virtualenv etc. I generally keep large packages in separate venvs -- but install stuff like mercurial in the "misc" one.
Note that the structure of my opt-folder mirrors that of eg. /usr/local, so:
mkdir -p ~/opt/{bin,include,lib,man,share}
(I also have src and xstow in there -- src for source packages I want to keep around, xstow for xstow-installed packages.)
And to repeat, if you put your xstow tree under /usr/local or somewhere most likely already in your path, it should "just work" without having to set any extra variables -- and is more useful for eg: installing a system wide service (like Redis for production use).
edit: forgot to add export of environment variables to the .bashrc snippet
edit: the "${HOME}/opt/${unps}" points to a directory that contains architecture specific binaries; the unps-variable, is set to be `uname -ps` (with some trickery) -- and is then used for finding local binaries and setting some options like PAGER.