Searching the APT database

Learn Photo Editing

Learn Photo Editing

Get Instant Access

So far so good, installing packages with APT is a piece of cake once you know the package name. APT provides comprehensive toolsto query the package database to obtain the desired package name(s), in addition to various resources online, which will be reviewed in the following sections.

The Debian web page features a section exclusively dedicated to its package pool21. The site provides three means to browse the collection of available packages. The "package lists" provide short blurbs for each package, while packages are sorted

21 http://packages.debian.org

into categories according to their function. By choosing a category, a user can quickly find a set of packages relevant to a certain requirement.

It is also possible to search the package database for package names, package descriptions, or even the contents of all packages to see which package provides a specific file. Further search criteria allow you to filter the set of results, making it easy to retrieve the necessary information for the command-line APT tools.

Finally, each package has a dedicated information page on the Debian web site. These pages are accessible through a canonical URL using the binary22 or source package name23. Some more information is available through the package tracking system (see chapter 10.6.9).

Instead of requiring a web browser, all this functionality is also available from the command line, in case you prefer not to go via the web interface. Most work is done by the apt-cache interface, which can be used to search the package database, including the package descriptions like so:

apt-cache search palm sync command line autopilot - Monitor the DTR line of /dev/palm and run a command to start sync malsync - Allows a PalmOS PDA to synchronize to a MAL server pilot-link - Tools to communicate with a PalmOS PDA

Theargumentsto apt-cache search are regular expressions themselves, and if more than one argument is specified, all of them have to match for a package to be included in the output. It is also possible to search only the package nameswith the --names-only option (APT::Cache::NamesOnly true). When specifying the --full switch (APT::Cache::ShowFull true), the full package information is displayed. This information is also accessible for each package directly and is essentially the same as available via dpkg --info and dpkg --show:

apt-cache show postfix Package: postfix Priority: extra

Provides: mail-transport - agent [...

Description: A high-performance mail transport agent [...

Searching the Debian archive for single files

Further search capabilities are available through the apt-file tool, available in the package with the same name, apt-file is essentially an interface to the Contents

22http://packages.debian.org/<package> 23 http://packages.debian.org/srcxpackage>

file found in APT repositories. This file isavailable for each distribution and contains a list of all files installed by the packages in the specific distribution. Before apt-file can be of any use, it has to have access to the Contents files the user wants to search. Running apt-file update will take care of that and place the downloaded files under /var/cache/apt. Now, apt-file can be used to search these lists.

The main use of apt-file is to determine which package provides a certain file. For instance, if someone told you to use the /usr/bin/convert tool to reformat a picture file, you could use apt-file to figure out that the imagemagick package is what you need to install:

apt-file search /usr/bin/convert imagemagick: /usr/bin/convert

Furthermore, apt-file is capable of displaying the files associated with a package. This is similar to dpkg —listfiles but does not require the package to be installed:

apt-file list postfix postfix: etc/init.d/postfix postfix: etc/postfix/access [---]

postfix: usr/lib/sendmail postfix: usr/sbin/postalias [...

Was this article helpful?

0 0
Understanding Adobe Photoshop Features You Will Use

Understanding Adobe Photoshop Features You Will Use

Adobe Photoshop can be a complex tool only because you can do so much with it, however for in this video series, we're going to keep it as simple as possible. In fact, in this video you'll see an overview of the few tools and Adobe Photoshop features we will use. When you see this video, you'll see how you can do so much with so few features, but you'll learn how to use them in depth in the future videos.

Get My Free Video


Post a comment