From Livedoc - The Documentation Repository
Jump to: navigation, search
Warning The information in this article may be outdated or obsolete.

Advanced Packaging Tool, or APT is the package management system used by Debian and several other Operating Systems and Linux distributions. For information on APT itself, look at the Wikipedia APT page. Note: most machines in the lab use Gentoo, and, as such, do not use APT.


The /etc/apt/sources.list controls what APT sources are used by a machine. We have a small script for generating this (generally for servers) for machines that want to use the Stable and Testing releases in sources.list. The first two arguments it takes are the mirror to use and the non-US mirror to use. If either or both are not specified, then default mirrors are provided in the script. Every day this script is run with no arguments by servers that run check packages so the sources in all servers is easily changed in one place.


Sometimes upgrading a package will break something, and you want to keep it at a certain version. If this happens, the easiest way to prevent it from getting upgraded when all packages on a machine are upgraded is to hold the package with dpkg. To hold a package, you basically do something like

 # echo 'packagename hold' | dpkg—set-selections

as root on a machine. Then dpkg --get-selections will report that package as status "hold". When upgrading, APT will refuse to upgrade the package unless you explicitly tell it to (apt-get install), and even then will give a warning. To stop holding a package, just

 # echo 'packagename install' | dpkg—set-selections

Should do it. In general, if you hold a package on a server, you should give a reason somewhere for doing so; the server's MOTD (unless it's a public server like robustus) or LiveDoc page would be good places. Before you forcefully install a held package, make sure you've found the reason it was held in the first place, and that you've fixed or invalidated whatever reason is was held for.


If we ever lose our DS3 connection again, using the apt-proxy program may be a good idea. It allows for a single server to cache .deb files for APT retrieval. Even if we keep our DS3, it still might be a good idea. That way, our sources.list files could all point towards a central CSL source, without having to change it. And we could create our own packages (for internal use only), virtual or otherwise.