Debian Package Management

Package management in the Debian system is handled through a program called APT. Package management is largely handled through releases. There are three branches of Debian releases at any given time, known as stable (Sarge), testing (Etch), and unstable (Sid).

The release of a Debian system is determined by the file /etc/apt/sources.list. This file lists the APT sources from which packages will be downloaded and installed. The following example is for a system running the Sarge release:

/etc/apt/sources.list:
deb ftp://mirrors.kernel.org/debian sarge main
deb http://non-us.debian.org/debian-non-US sarge/non-US main
deb http://security.debian.org/ sarge/updates main

This file specifies the Debian mirror mirrors.kernel.org as the APT repository to use. This mirror offers the most throughput and highest connectivity rates to the ServePath network.

To update all installed packages,

# apt-get update && apt-get dist-upgrade

This will update any Debian system with the latest packages on the APT repository specified in /etc/apt/sources.list, and intelligently update all installed packages, as well as any dependencies that may arise.

To remove an installed package, first execute the following to find the package name,

# dpkg –l

Once the package name has been retrieved, execute the below to uninstall,

# apt-get remove <package-name>

To install a package,

# apt-get install <package-name>

To find out what package a program belongs to,

# apt-get update && apt-cache search <program-name>

Some of the above may require a pager such as more or less to effectively view the results