[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ] [ next ]


The Debian GNU/Linux FAQ
Chapter 7 - The Debian package management tools


7.1 What programs does Debian provide for managing its packages?

There are multiple tools that are used to manage Debian packages, from graphic or text-based interfaces to the low level tools used to install packages. All the available tools rely on the lower level tools to properly work and are presented here in decreasing complexity level.

It is important to understand that the higher level package management tools such as aptitude or dselect rely on apt which, itself, relies on dpkg to manage the packages in the system.

See the APT HOWTO for more information about the Debian package management utilities. This document is available in various languages and formats, see the APT HOWTO entry on the DDP Users' Manuals overview.


7.1.1 dpkg

This is the main package management program. dpkg can be invoked with many options. Some common uses are:


7.1.2 APT

APT is the Advanced Package Tool and provides the apt-get program. apt-get provides a simple way to retrieve and install packages from multiple sources using the command line. Unlike dpkg, apt-get does not understand .deb files, it works with the packages proper name and can only install .deb archives from a source specified in /etc/apt/sources.list. apt-get will call dpkg directly after downloading the .deb archives[4] from the configured sources.

Some common ways to use apt-get are:

Note that you must be logged in as root to perform any commands that modify the system packages.

The apt tool suite also includes the apt-cache tool to query the package lists. You can use it to find packages providing specific functionality through simple text or regular expression queries and through queries of dependencies in the package management system. Some common ways to use apt-cache are:

For more information, install the apt package and read apt-get(8), sources.list(5) and install the apt-doc package and read /usr/share/doc/apt-doc/guide.html/index.html.


7.1.3 aptitude

aptitude is a package manager for Debian GNU/Linux systems that provides a frontend to the apt package management infrastructure. aptitude is a text-based interface using the curses library, it can be used to perform management tasks in a fast and easy way.

aptitude provides the functionality of dselect and apt-get, as well as many additional features not found in either program:

You can use aptitude through a visual interface (simply run aptitude) or directly from the command line. The command line syntax used is very similar to the one used in apt-get. For example, to install the foo package, you can run aptitude install foo.

Note that aptitude is the recommended program by Debian to install a package and/or to upgrade your system.

For more informations, read the manual page aptitude(8) and install the aptitude-doc-en package.


7.1.4 dselect

This program is a menu-driven interface to the Debian package management system. It is particularly useful for first-time installations. Some users might feel more comfortable using aptitude which is also recommended over dselect for large-scale upgrades. For more information on aptitude please see aptitude, Section 7.1.3.

dselect can:

dselect begins by presenting the user with a menu of 7 items, each of which is a specific action. The user can select one of the actions by using the arrow keys to move the highlighter bar, then pressing the <enter> key to select the highlighted action.

What the user sees next depends on the action he selected. If he selects any option but Access or Select, then dselect will simply proceed to execute the specified action: e.g., if the user selected the action Remove, then dselect would proceed to remove all of the files selected for removal when the user last chose the Select action.

Both the Access menu item and the Select menu item lead to additional menus. In both cases, the menus are presented as split screens; the top screen gives a scrollable list of choices, while the bottom screen gives a brief explanation ("info") for each choice.

Extensive on-line help is available, use the '?' key to get to a help screen at any time.

The order in which the actions are presented in the first dselect menu represents the order in which a user would normally choose dselect to install packages. However, a user can pick any of the main menu choices as often as needed (including not at all, depending on what one wants to do).


7.1.5 Other package management tools


7.1.5.1 dpkg-deb

This program manipulates Debian archive(.deb) files. Some common uses are:

Note that any packages that were merely unpacked using dpkg-deb --extract will be incorrectly installed, you should use dpkg --install instead.

More information is given in the manual page dpkg-deb(1).


7.1.5.2 dpkg-split

This program splits large package into smaller files (e.g., for writing onto a set of floppy disks), and can also be used to merge a set of split files back into a single file. It can only be used on a Debian system (i.e. a system containing the dpkg package), since it calls the program dpkg-deb to parse the debian package file into its component records.

For example, to split a big .deb file into N parts,


7.2 Debian claims to be able to update a running program; how is this accomplished?

The kernel (file system) in Debian GNU/Linux systems supports replacing files even while they're being used.

We also provide a program called start-stop-daemon which is used to start daemons at boot time or to stop daemons when the kernel runlevel is changed (e.g., from multi-user to single-user or to halt). The same program is used by installation scripts when a new package containing a daemon is installed, to stop running daemons, and restart them as necessary.


7.3 How can I tell what packages are already installed on a Debian system?

To learn the status of all the packages installed on a Debian system, execute the command

     dpkg --list

This prints out a one-line summary for each package, giving a 2-letter status symbol (explained in the header), the package name, the version which is installed, and a brief description.

To learn the status of packages whose names match the string any pattern beginning with "foo" by executing the command:

     dpkg --list 'foo*'

To get a more verbose report for a particular package, execute the command:

     dpkg --status packagename

7.4 How can I find out what package produced a particular file?

To identify the package that produced the file named foo execute either:


7.5 Why doesn't get `foo-data' removed when I uninstall `foo'? How do I make sure old unused library-packages get purged?

Some packages that are split in program (`foo') and data (`foo-data'). This is true for many games, multimedia applications and dictionaries in Debian and has been introduced since some users might want to access the raw data without installing the program or because the program can be run without the data itself, making it optional.

Similar situations occur when dealing with libraries: generally these get installed since packages containing applications depend on them. When the application-package is purged, the library-package might stay on the system. Or: when the application-package no longer depends upon e.g. libdb4.2, but upon libdb4.3, the libdb4.2 package might stay when the application-package is upgraded.

In these cases, `foo-data' doesn't depend on `foo', so when you remove the `foo' package it will not get automatically removed by most package management tools. The same holds true for the library packages. This is necessary to avoid circular dependencies. If you use aptitude (see aptitude, Section 7.1.3) as your package management tool it will, however, track automatically installed packages and remove them when no packages remain that need them in your system.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ 11 ] [ 12 ] [ 13 ] [ 14 ] [ 15 ] [ next ]


The Debian GNU/Linux FAQ

version 3.1.3, 25 April 2006

Authors are listed at Debian FAQ Authors