Debian Package Management, Part 1: A User's Guide

A HOWTO for Debian package management.

I have not yet found another distribution that makes upgrading to a new version as easy as Debian does. As mentioned previously, when you want to upgrade your version, simply change the distribution part of the URI in /etc/apt/sources.list, then do an apt-get dist-upgrade. Often, it helps to run apt-get dist-upgrade a few times to get everything happily installed and configured. You can only use this to go to a newer version, from stable to frozen, stable to unstable or frozen to unstable. You cannot downgrade.


apt-cache is great for finding information about packages, even packages you don't have installed! The command apt-cache show <package> will print various information about the package, including dependencies, full name, what it provides, the short and long descriptions, and, most importantly, the size when unpacked. apt-cache depends <package> provides a list of what other packages the selected <package> needs installed to work properly. To print a complete list of every package available, use apt-cache pkgnames.

The most useful feature of apt-cache that I've found has to be apt-cache search <string>. This option will search through all package names and descriptions looking for occurrences of your <string> selection. Obviously, this can be a great time-saving device.

To further assist your managing capabilities, there are some options that apt-cache can utilize. For example, -i lists only the important dependencies, -f prints full records (just like “show”) after a search and -names-only limits searches to package names.


While I can usually get by with dpkg for package management, apt-cache for searching and apt-get for installation, sometimes I want to get a better idea of what's available to me. This is where dselect, console-apt and gnome-apt come in.


dselect is the granddaddy of the Debian frontends. As the first part of the installation process, it is the first thing new Debian users are greeted with, and it scares them. And it's true that dselect can be incredibly scary as well as incredibly dense. This section will be the short and sweet introduction to dselect. First, my best advice when using dselect is to read all of the on-screen help. Although not very user-friendly, everything you need to know is contained there.

Figure 1. Dselect-Inspection of Package States

When you first start dselect, you'll want to go to “[A]ccess” to select the correct access method for installation. Meaning, select “nfs” if you have a local nfs mirror of Debian, and “apt” if you want to install over the Internet (http/ftp) or if you've configured your sources.list for local addresses. Other methods available are CD, Multi-CD (if your distribution has multiple CD-ROMs as opposed to one), Floppy and Mounted.

Once you've selected your access method, dselect needs to find out what packages it has access to; to accomplish this, select “[U]pdate” and wait a minute.

“[S]elect” is where the actual package management happens. First, you'll be presented with a help screen. READ IT! When you finish READING IT, press space to get out of help or “.” to read the keybindings. You can move around the package listings by searching or by using up/down, page-up/page-down, home/end and left/right. The following are some basic, useful keystrokes in dselect:

/ search\ repeats the last search? brings up helpd scrolls down the package informationu scrolls up it

When you've highlighted a package you want to do something with, use:

+ install or upgrade- remove= leave in present state

When you're ready to leave the selection screen, select:

<enter> to confirm, quit and check dependenciesQ to quit, confirm and override dependenciesX or Esc to abandon all changes

After you press return, you may be presented with a list of packages; these may be either dependencies of or conflicts with the packages you selected. Look at the packages; the bottom half of the screen will tell you what the problem is. Once you've resolved these problems, press enter.

After you've made your changes in “[S]elect”, either “[I]nstall” or “[R]emove” which will bring your system up to date with the changes. “[C]onfig” is only necessary if any package configuration failed.