Search for a Debian Package

Methods for searching for a package

A package that is already installed?

1. Use dpkg

To search for an installed package including the file "toto":

      dpkg      -S toto

To search for the package "toto":

      dpkg      -l toto

It is often preferable to generalize, and search for all packages with "toto" in their name:

      dpkg      -l '''toto'''

or, like this, with grep:

      dpkg      -l || grep toto

2. Use the package, dlocate

In fact, this program does, more or less, the same thing as dpkg, but it does it even quicker. For more information, see man dlocate

An official package (installed or not) ?

1. Use apt-cache (available since Debian 2.2)

apt-cache allows quickly searching among the entire list of available debian packages. For the most current use, use the "search" option with a rational expression as a parameter.

 apt-cache      search emacs

This will post the names of all packages containing the expression "emacs" in the name or description. If you wish to search only for those packages with the expression in the name, add the option --names-only:

 apt-cache      search --names-only emacs

 apt-cache      show nom-paquet

This will provide a more complete description of the package named "emacs".

Another option is to use aptitude search.

aptitude search emacs

This will provide, basically, the same information as apt-cache search.

2. Ask robots irc

Connect to the irc server at irc.debian.org, join channel #debian, then: (with "toto" as the name of the package or file): (translator note: I think this is outdated, and one needs to connect to irc.freenode.net, then join #debian)

  % <mt> /msg dpkg !find toto <dpkg> toto is in package:
  bla...bla

If you can't search in the unstable distribution, but, for example slink, it is not more difficult.

  % <mt> /msg dpkg !find toto slink

3. Search the Debian website

Try here: http://www.debian.org/distrib/packages The Debian site now has a built in search engine.

A package that has been removed from Debian

For various reasons, a package may be removed from Debian, and no longer be easily accessible. Here is a clue for your search: http://snapshot.debian.org

This site covers all debian packages, including those which have been removed from Debian due to excessive bugs, security problems, etc. It does not, however, retain packages that have been removed for licensing issues.

The site offers a classic, but configurable, package recovery system (Debian sources):

An unofficial package

For various reaons, it may be useful (or necessary) to install "unofficial" Debian packages, not provided in the official Debian sources. There a a myriad of unofficial sources, each meeting a particular need (specifically configured or recomplied applications, for instance).

We have a site to identify and evaluate the quality of "unofficial" sources.

Site for finding unofficial sources: http://www.apt-get.org

Any random package?

What follows are two rather general methods for finding packages. The first is use to search for a package (or it could be used for finding a config file, easily enough), and the second is used to find a file.

1. Run grep on the apt-get files. This works for all packages that you can install with

  apt-get       install

(meaning, those available in the repositories listed in your /etc/apt/sources.list )

These files are available in /var/lib/apt/lists

Example : Search for the cddb package:

 grep -h -15 "Package: cddb" /var/lib/apt/lists/* || pager

This gives (amont other junk):

 Package: cddb 
 Priority: optional 
 Section: sound 
 Installed-Size: 86
 Maintainer: Adrian Bridgett <bridgett@debian.org> 
 Architecture: i386
 Source: xmcd 
 Version: 2.6-10 
 Replaces: xmcd (<=2.3-1) 
 Depends: libc6  (>= 2.2.3-7) 
 Conflicts: suidmanager (<<0.50) 
 Filename:  pool/main/x/xmcd/cddb_2.6-10_i386.deb

2. Run grep on a file Contents-<arch_.gz (This file is made for that). This works to search for a package even if not installed from the official distribution (or from the unofficial packages, if the sources have been designed and such a file made available). This file can be found in various locations:

  % <mount point>''dists''<distribution>/Contents-<arch>.gz

For example:

  % /mnt/cdrom/dists/stable/Contents-i386.gz

  % <ftp address>''dists''<distribution>/Contents-<arch>.gz