Debian Package Management: Part 1

Debian’s package management system is undoubtedly one of the most powerful in the Linux world. But users new to this wonderful distro often get confused when confronted with anything but the most trivial package management tasks.

This article attempts to clarify some of the basic concepts that must be understood in order to use these tools effectively.

Let’s get started!

Debian Packages:

The Debian GNU/Linux system provides over 18,000 packages for its users. But then, what is a package? Did the folks at Debian develop all this software? The answers are provided in the Debian FAQ:

“Packages generally contain all of the files necessary to implement a set of related commands or features. There are two types of Debian packages:

Binary packages, which contain executables, configuration files, man/info pages, copyright information, and other documentation. These packages are distributed in a Debian-specific archive format. They are usually distinguished by having a ‘.deb’ file extension.

Source packages, which consist of a .dsc file describing the source package (including the names of the following files), a .orig.tar.gz file that contains the original unmodified source in gzip-compressed tar format and usually a .diff.gz file that contains the Debian-specific changes to the original source.”

As for the second question.. No, all those packages weren’t developed by the Debian developers (kinda obvious, isn’t it?). Various people around the globe volunteer to become “maintainers” for Debian. What these guys essentially do is package existing software into .deb packages. Additionally, they are also responsible for bug-tracking and maintaining the package in general.

Debian releases:

Before getting on with packages and package management, a few words about Debian Releases is in order. Debian always maintains at least three releases at any given time. They are:

stable: The stable distribution contains the latest officially released distribution of Debian. This is the production release of Debian, and the one which you are most probably using right now.

testing: The testing distribution contains packages that haven’t been accepted into a stable release yet, but they are in the queue for that. The main advantage of using this distribution is that it has more recent versions of software.

unstable: The unstable distribution is where active development of Debian occurs. Generally, this distribution is run by developers and those who like to live on the edge.

Currently, the stable, testing and unstable releases are named Etch, Lenny and Sid, respectively.

New users should generally stay away from testing and unstable. It is the stable release which provides the most stability and security.

A note on the Debian FTP archives:

The software that has been packaged for Debian GNU/Linux is available in one of several directory trees on each Debian mirror site.

The tree structure is modelled on the Debian releases.. as expected. There is a dists directory, which contains stable, unstable and testing (Codenames such as Etch are symlinks to one of the 3 releases).

The stable directory contains 3 directories:

/stable/main – This directory contains the packages which formally constitute the most recent release of the Debian GNU/Linux system

/stable/non-free – This directory contains packages distribution of which is restricted in a way that requires that distributors take careful account of the specified copyright requirements.

/stable/contrib – This directory contains packages which are DFSG-free and freely distributable themselves, but somehow depend on a package that is not freely distributable and thus available only in the non-free section.

Package Management Tools – A brief overview:

Now that we are clear on the basics of a Debian system, we can get to the task at hand – getting to know the tools of the trade.

The dpkg tool is the root of the entire Debian package management system. It is used to install, query, remove and update individual packages. Though a very powerful tool on its own, the power of the Debian system comes from its ability to manage multiple packages, managing conflicts and dependencies among them, and keeping the entire system in perfect shape.

Next comes the apt tool. It runs on top of dpkg and provides the necessary options to control packages in the system as a whole. It fetches packages from remote locations and can manage complex inter-package relationships. Hell, you can upgrade your entire Debian system with a single apt command!

Running on top of apt are tools like aptitude and synaptic. aptitude is an ncurses-based front end for apt. It lets users interactively pick packages to install or remove. Similarly, synaptic and kpackage are apt front ends designed for GTK and KDE respectively.

Part 2 >>


2 thoughts on “Debian Package Management: Part 1

  1. I found your site on google blog search and read a few of your other posts. Keep up the good work. Just added your RSS feed to my feed reader. Look forward to reading more from you.

    – Sue.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s