Department of Computer Science and Technology

Software installation using apt-get

There are several interfaces to add packages to a system, some are graphical and others are command line. The most common is apt (advanced Packaging Tool). This can be used for all aspects of package management.

One of the problems of installing a package is knowing its name.

apt-cache pkgname

will give a list of all packages available. This list is rather long so it is usually best to search for a particular $string such as

apt-cache search $string

Having found the $package you want to load you can check you have the correct one by examining its short description

apt-cache show $package

When you load a package it will also load any other packages it depends on. You can find out what will also be loaded by

apt-cache showpkg $package

To actually install the package you can use

cl-asuser apt-get install $package

it is possible to install multiple packages at once by listing them one after the other, separated by a space.

If you need to install a particular version of a package then you use the syntax

cl-asuser apt-get install $package=$version

where $version can be found form the apt-cache showpkg command.

If you are using a managed Linux machine then after you have installed a package and decided you want to keep it then you should ensure you add it to the end of the file /etc/user-config/bundles, that will ensure your package is kept up to date and if your machines fails then its replacement will also have the package installed.

If you loaded a package and no longer require it then it can be fully removed using

cl-asuser apt-get remove --purge $package

where the purge option clears out any configuration files as well as the package files.