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 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 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 PYTHONPATH=${HOME}/local/lib/python/site-packages:${HOME}/local/lib/${PYTHON_VERSION}/site-packages:${HOME}/local/lib/${PYTHON_VERSION}/dist-packages:${HOME}/local/lib/python/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.

Now just for illustration purposes, an installation of a generic project is made with the following steps:

  • Make the basic directory structure
mkdir -p local/src
mkdir -p local/DIR
  • Download the source code to local/src and then compile it setting the installation directory to DIR/name-of-project:
cd local/src
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
Enter your comment. Wiki syntax is allowed:
If you can't read the letters on the image, download this .wav file to get them read to you.
  • tutorials/using_xstow_for_local_installations.txt
  • Last modified: 2018/11/26 11:42
  • by amora