Installing software locally

From CsWiki
Jump to: navigation, search

When you need software that isn't installed on CSE system, you can install it locally.

Python Packages

Using pip

Installing python packages may be done using a virtual environment as described here

For example

csusername@river:~% virtualenv my-venv-p3.7 -p python3.7 --system-site-packages
csusername@river:~% source my-venv-p3.7/bin/activate.csh
[my-venv-p3.7] csusername@river:~% pip install cowsay

Example of using the package:

[my-venv-p3.7] csusername@river:~% python -c "import cowsay; cowsay.tux('I installed cowsay package')"

Compile Python packages using build

As with pip insallation, compiling python packages is done within an active virtualenv.

  • Create a virtualenv as described here
  • Activate it
  • Download the software, uncompress it if needed and change to the directory
  • Run python build, you may run python --help to see if you need to pass some extra parameters
  • After successful compilation, run python install (no sudo needed). The package will be installed under your activated virtualenv

Pre-compiled software

In case you need a pre-copiled software you may search for local installation such as tar.gz file, open it on a directory where you have write permissions (like sub-directory on your home directory, for example) and run the executable from this directory.

For example: installing Free42, simulator of HP-42s from


csusername@river:~/Downloads%  wget

List files to see the content:

csusername@river:~/Downloads%  tar tvf Free42Linux.tgz

In case the files aren't stored under a directory, create one:

csusername@river:~/Downloads%  mkdir free42

Extract the files:

csusername@river:~/Downloads%  tar xf Free42Linux.tgz -C free42

Run it from that location:

csusername@river:~/Downloads%  ~/Downloads/free42/free42dec

Other software

Compiling software for local installation

In order to compile and install software using local installation you'll have to:

  • Download the source code
  • Compile it, while making sure the target installation is not the default but a place you have write permissions on (like a directory under your home directory. or ~/.local)
  • Run 'make install' without sudo
  • Run it from that chosen directory

Make sure to read the compilation instructions, in order to find out how to set the installation location on a chosen directory instead of the default one.

For example: installing cmatrix from source code

The code can be found at:

The instructions tell us that we can compile and install using autoconf tools or CMake, and instruct how to choose a custom installation location


csusername@river:~/Sources%  git clone

Creating configure tool using autoconf:

csusername@river:~/Sources%  cd cmatrix
csusername@river:~/Sources/cmatrix%  autoconf -i error: possibly undefined macro: AM_CONFIG_HEADER
     If this token and others are legitimate, please use m4_pattern_allow.
     See the Autoconf documentation. error: possibly undefined macro: AM_INIT_AUTOMAKE error: possibly undefined macro: AM_CONDITIONAL

Search google for this error and findout how to fix it (some libraries are missing, the below command fetches them as well. run autoreconf --help to see the parameters explanation):

csusername@river:~/Sources/cmatrix%  autoreconf -fvi

Configure before compilation, choosing an installation prefix, I choose here .local under my home directory:

csusername@river:~/Sources%  ./configure --prefix=`echo ~`/.local

In case that some needed libraries are missing, you can download them and run './configure --help' to find out how to configure it to search them there.

Actually compiling:

csusername@river:~/Sources%  make

If no errors, install it. You do not need root privileges because you choose a writable installation location:

 csusername@river:~/Sources%  make install

Now you can run the executable. You'll have to use the full path (unless you set it up on your $PATH environment variable):

 csusername@river:~/Sources%  ~/.local/bin/cmatrix

(Use q to quit :) )

When autoconf or --prefix are not available

Follow the compilation instructions and make them until you get to "make install". Instead of "make install" (and assuming you want to install it under ~/.local) run it as follow:

csusername@river:~/Sources%  make DESTDIR=~/.local install

The binaries and shared libraries will be installed under ~/.local/ or ~/.local/usr/ or ~/.local/usr/local/

Setting up environment variables for running from local installation

For the system to find the executables, add your binaries path to the PATH variable, and your libraries path to LD_LIBRARY_PATH environment variable:

setenv PATH ${PATH}:${HOME}/.local/bin
setenv LD_LIBRARY_PATH ${HOME}/.local/lib