Using Debian’s superior package management system (APT)
This article was first written in January 2005 for the BeezNest technical website (http://glasnost.beeznest.org/articles/197).
Debian’s APT is probably the best packaging system available today. The last relevant drawback, packages signing, has been fixed recently, and will be part of Etch and following.
In the meanwhile, let’s try to approach the «Beast».
APT is «just» a set of frontends to the underlying dpkg
So, some of the manipulations done using APT may benefit of using dpkg directly instead. For example, manipulating an already installed package or a package which is already available on the local filesystem.
APT is a set of tools including, but not limited to: apt-get, apt-cache and aptitude. Their main role is to search and retrieve packages and their dependencies and pass them to dpkg. Their configuration files are stored in /etc/apt/ on your favorite OS.
The sources of the packages are listed in /etc/apt/sources.list, which is therefore mandatory.
Using apt is pretty simple, once you get some basic rules: Use apt-get for retrieving (downloading or copying from a CD or other supported media), installing and removing packages. Use apt-cache for information about packages, like their existence or not in Debian, their names, descriptions, version numbers available, … Use aptitude for enhanced features over apt-get, which it basically builds upon.
But let’s see in practise
Searching a package based on keywords in the name or description of the package:
$ apt-cache search keyword1 keyword2
Check the package version available (from sources in sources.list)
$ apt-cache policy package_name
Show more information about the same package [1
$ apt-cache show package_name
Install it and all of its dependencies
$ sudo apt-get install package_name
 the same for a package already installed would be dpkg -l package_name