Using xstow for local installations

• Install xstow
  sudo apt-get install xstow
• We need to modify some environmental variables (in your .bashrc file):
export PYTHON_VERSION=$(basename$(readlink -e $(which python))) export PYTHON3_VERSION=$(basename $(readlink -e$(which python3)))
export PATH=${HOME}/local/bin:${HOME}/local/sbin:${HOME}/local/usr/bin:${PATH}
export LD_LIBRARY_PATH=${HOME}/local/lib:${HOME}/local/usr/lib:${LD_LIBRARY_PATH} export LIBRARY_PATH=${LD_LIBRARY_PATH}:${LIBRARY_PATH} export CPATH=${HOME}/local/include:${HOME}/local/usr/include:${CPATH}
export LDFLAGS="-L${HOME}/local/lib${LDFLAGS}"
export PKG_CONFIG_PATH=${HOME}/local/lib/pkgconfig export CMAKE_INCLUDE_PATH=${CPATH}
export CMAKE_LIBRARY_PATH=${LIBRARY_PATH} export PYTHONPATH=${HOME}/local/lib/python/site-packages:${HOME}/local/lib/python3/site-packages:${HOME}/local/lib/${PYTHON_VERSION}/site-packages:${HOME}/local/lib/${PYTHON_VERSION}/dist-packages:${HOME}/local/lib/${PYTHON3_VERSION}/site-packages:${HOME}/local/lib/${PYTHON3_VERSION}/dist-packages:${HOME}/local/lib/python/dist-packages:${HOME}/local/lib/python3/dist-packages:${PYTHONPATH}
• Please add this exports to the .bashrc file in your home directory. Please logout and login from your graphical session after modifying the .bashrc file. This is necessary in order to have the changes available in any new opened console.
• Make the basic directory structure
  mkdir -p local/src
mkdir -p local/DIR

Example

The following is an example of how to use xstow. This will fail if you try to follow it.

• Download the source code to local/src and then compile it setting the installation directory to DIR/name-of-project:
cd local/src
wget http://example.com/example.tar.gz
tar -xzf example.tar.gz
cd example
./configure --prefix=\${HOME}/local/DIR/example
make -j10
make install
• Xstow it!
cd ~/local/DIR
xstow example
• The last step creates symbolic links one directory up, in effect enabling the program
• Now the example project is as useful as if it would be installed in the system directories.
• To disable example:
cd ~/local/DIR
xstow -D example
• tutorials/using_xstow_for_local_installations.txt