TCM
UoC crest

Installing Software

It is likely at some point you will wish to install some software yourself. The advantage of UNIX-based systems is that this rarely requires any administrator privilege. Once several people in TCM are using the same software it makes sense to ask that it be installed and maintained centrally, but for a quick exploration by a single person this makes no sense.

LaTeX packages

LaTeX generally searches the current directory for packages before any system directories, so placing a package in the same directory as the LaTeX source file is often a quick answer.

The next most sophisticated answer is to install in your own personal TeX tree. LaTeX is configured to search a tree in your home directory called texmf, so:

$ mkdir -p ~/texmf/tex/latex/chouse
$ cp chouse.cls ~/texmf/tex/latex/chouse/chouse.cls

should suffice to install a class file called "chouse.cls".

Programs

Many, many programs can be successfully installed without any system privilege. The UIS runs a useful course called "Unix: Building, Installing and Running Software" whose synopsis reads "it is common for a student or researcher to find a piece of software or to have one thrust upon them by a supervisor which they must then build, install and use. It is a myth that any of this requires system privilege. [...] by the end of the course the student should be able to manage their own software without needing to pester their system administrator."

You will find that the directory ${HOME}/bin is on your default PATH. So simply placing executables there might work. Or, for building from source, which is best done from /scratch, typing

./configure --prefix=${HOME}
make install

might suffice. Larger packages are better installed in your /rscratch directory, perhaps with symbolic links placed in your ${HOME}/bin directory. There are also notes on rpms and debs below.

Python Modules

We now have a separate page discussing pip, python and *conda.

tars

A tar file is very easy to deal with, as generally it is meant to be extracted and run from anywhere. To extract, simply type

tar -xf foo.tar

With modern tar commands, such as in TCM, this will work regardless of whether the tar file ends .tar, .tar.gz, .tgz, or .tar.bz2.

rpms and debs

Linux packages contain an archive of the program itself, a list of dependencies, a desciption, pre- and post-installation scripts, and a few other things too. However, in many cases it is possible to install a package, to any location, simply by extracting the files from the achive within it. A suitable command might be:

$ rpm2cpio foo.rpm | cpio -id

which would be best typed in /scratch or /rscratch, for it is likely to produce a large number of files in directory trees starting usr and/or opt. The binary you wish to run will probably be found in usr/bin. This method is used in TCM for installing LibreOffice, and the Intel compiler suite.

To manipulate .deb files, one can use ar.

$ ar t opera-beta_26.0.1656.20_amd64.deb 
debian-binary
control.tar.gz
data.tar.xz
$ ar p opera-beta_26.0.1656.20_amd64.deb data.tar.xz | tar --xz -xf -

The listing of the contents is necessary because not all debs use the xz compression algorithm, so the data filename which is extracted to stdout in the next step may not end .xz, nor want the --xz option to tar.

Opera is awkward in that it is linked against an old version of libudev, and prefers to be able to use a suid root helper, which is unavailable if not installed by root. However, the above install is still usable:

$ ln -s /usr/lib64/libudev.so.1 usr/lib/libudev.so.0
$ LD_LIBRARY_PATH=`pwd`/usr/lib usr/bin/opera-beta --no-sandbox

To make the result more friendly, one would probably create a script in one's ~/bin directory reading something like:

#!/bin/bash
LD_LIBRARY_PATH=/scratch/spqr1/usr/lib export LD_LIBRARY_PATH
exec /scratch/spqr1/usr/bin/opera-beta --no-sandbox ${1+"$@"}

Snaps

It is often possible to run snap packages simply by extracting the package (probably in /scratch -- they can be large!) with unsquashfs. The contents will appear under squashfs-root.

Fonts

The last, but perhaps the simplest. Truetype or Opentype fonts can be placed in a directory called

~/.local/share/fonts

and then any fontconfig aware application should find them. This includes LibreOffice, Scribus, Inkscape, gnome-terminal, and many others. As an example:

$ wget http://www.fontsquirrel.com/fonts/download/alex-brush
$ unzip alex-brush
Archive:  alex-brush
  inflating: AlexBrush-Regular.ttf   
  inflating: SIL Open Font License.txt
$ mkdir -p ~/.local/share/fonts
$ mv AlexBrush-Regular.ttf ~/.local/share/fonts
$ rm SIL\ Open\ Font\ License.txt

This, assuming that Font Squirrel changes nothing, should be sufficient to add the Alex Brush calligraphic font to one's account. This can quickly be checked using a program such as gtk2fontsel.

(This procedure will not suffice for LaTeX.)