This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new!

Feature: System Administration

Searching for package information on Debian and Ubuntu systems

By Bruce Byfield on October 28, 2008 (3:00:00 PM)

Share    Print    Comments   

New Linux users may be content with automatic updates and the package information shown by desktop tools, but more experienced users are generally more cautious and demanding. Experienced users, for instance, may want to assess the risk of an upgrade by studying its dependencies before they begin, or to overcome a package conflict by using versions from an older repository. Because of Debian's long history of providing for advanced users, this sort of information is available from several different sources -- from the apt-cache command, from distribution Web sites, and, in Ubuntu, with the new Ubuntu Simple Package Crawler. Unfortunately, no single source has all the features you are likely to want.

You're likely to need additional information about applications because of the limitations of the resources installed by default. Debian's dpkg and dpkg-query commands give detailed information about the packages and associated files on your system, but are of limited use with other packages. Similarly, apt-get's main contribution to planning is the --simulate switch, which allows you to see what will happen if you try to install a particular package (you can also use --just-print, --dry-run, --recon, and --no-act, all of which have the same function as --simulate). But none of these switches gives you the complete information that you might want before installation, such as a detailed description of a package, what it conflicts with, or packages that might enhance the package.

Nor are desktop package management tools Synaptic or Adept, nor the text-based Aptitude, much better. All support simple searches that can crawl the repositories listed in the /etc/apt/sources.list file and find results for partial package names, but, so far as I can find, none can search using regular expressions, which means that you can easily miss related packages with slightly different names that might interest you.

By contrast, the apt-cache command gives more of the sort of information that you are likely to want at the planning stage, searching both package names and descriptions. It use the following format: apt-cache action string. For instance, apt-cache search pysol* finds all packages that include the string "pysol*" -- and, you will notice, apt-cache supports regular expressions in its search. You can also use the depends action to find all dependencies for your search, or redepends to find all the other packages that depend on those for which you are searching. If you want the various versions in the repositories you are using, then you can add the --all-versions switch.

If you are not comfortable at the command line, and do not want to update your active repositories simply so you can search them, you may be more comfortable with the Debian or Ubuntu online package search pages. These are essentially the same tools, with Ubuntu's being a modified version of Debian's.

From either search page, you can choose whether to search repository directories, or the contents of packages. If you choose to search the directories, you can specify whether to search package names, their descriptions, or source packages, and whether to limit the search by release (in Ubuntu's case) or repository (in Debian's). If you choose instead to search by package content, you can also search by hardware architecture, or three limiting options: paths ending with the keyword, packages that contain files name like this, and packages that contain files whose names contain the keyword. Because of these limited options, searching the contents of packages is often the most useful option, since -- annoyingly -- neither searching repository directories nor searching the contents of packages supports regular expressions, and the Debian page may limit the display of results if your search string is too broad.

On both distributions' search pages, you get a list of all results; the Ubuntu list is conveniently divided into exact hits and possibly related ones. Drilling down to an individual result, you will find a list of related packages, divided into depends (packages that you must install to run the package listed), recommends (packages that enhance the package listed, but aren't necessary), and suggests (packages that might interest you, given your search). At the bottom of the page are links to the actual packages, arranged by architecture, although in most cases you are better off using apt-get or its graphical equivalent than downloading and installing a package by itself.

The main disadvantage of the Debian and Ubuntu search pages -- aside from the fact that your Internet connection might occasionally be down, or the pages offline for maintenance -- is the fact that you have to drill down three or four pages to find the information you want. This limitation is what makes the recently released Ubuntu Simple Package Crawler (USPC) potentially so attractive. Currently at version 0.4, USPC is approximately a KDE equivalent of the search engine found on the Ubuntu Web searcher. It can search on release and architecture, and list dependencies, but dispenses with the "recommends" and "suggests" categories -- an omission that makes missing handy additions all too easy. For some reason, it also has an option to omit from search results any package that is installed by default in Ubuntu -- perhaps on the grounds that such basic software should not be lightly updated. All the same, if USPC eventually provides more of the options that the Web searchers do, it may become a welcome addition to Ubuntu's search tools, and one that I hope is imported to Debian as well.

Except for USPC, all these tools are usable with other distributions derived from Debian or Ubuntu; which Web searcher you should use, of course, depends on which distribution your distro gets its packages from. None of these choices is perfect, but, by employing them in appropriate combinations, you should be able to plan your software installations and upgrades more intelligently -- and with fewer disasters -- than with the default desktop tools alone.

Bruce Byfield is a computer journalist who writes regularly for

Share    Print    Comments   


on Searching for package information on Debian and Ubuntu systems

Note: Comments are owned by the poster. We are not responsible for their content.

Searching for package information on Debian and Ubuntu systems

Posted by: Anonymous [ip:] on October 28, 2008 03:48 PM
I believe Aptitude's search does accept regular expressions. I know version 0.4.9 does on my systems.


Searching for package information on Debian and Ubuntu systems

Posted by: Anonymous [ip:] on October 29, 2008 09:09 AM
You really want to look further into aptitude manual, which has a very powerful search feature...

You also forgot to mention apt-file, which can perform search on the content packages which are not currently installed.

I personally use a combination of :
- "aptitude search" to find information about packages (description, dependencies, installation status)
- "dpkg -S <file>" to find out which package a particular file belongs to
- "dpkg -L <package>" to find out which files a package contains
- as dpkg only queries installed package, is use "apt-file find <file>" and "apt-file list <package>" as a last resort. apt-file works on the full database of packages, installed or not...and it supports regexp as well. The only drawback being it is generally much slower than its counterparts...


Searching for package information on Debian and Ubuntu systems

Posted by: Anonymous [ip:] on October 29, 2008 12:32 PM
Mostly I use "aptitude search" for finding packages, and "aptitude show" for viewing more detailed information about specific packages. Aptitude has an additional ncurses frontend that can be used for browsing the available packages in Debian by categories. Aptitude's ncurses interface includes also a debtags browser that groups packages into several different categories that can help you to find similar packages.

There's also a GUI browser, "goplay", that you can use to search the available games in Debian. Goplay utilizes debtags in order to group similar games.


Searching for package information on Debian and Ubuntu systems

Posted by: Anonymous [ip:] on October 30, 2008 03:25 AM
Kio-Apt is an apt:/ protocol in konqueror which provides apt-cache functionalities.

Kio-Apt project is an apt:/ protocol in konqueror which provides apt-cache functionalities :

Here are some key features of "Kio Apt":

� apt:/search?search_string
� apt:/show?package
� apt:/policy?package

and a few dpkg functionalities too:

� apt:/list?package lists the file in a package
� apt:/fsearch?file finds the package which owns the specified file


Searching for package information on Debian and Ubuntu systems

Posted by: miksuh on October 30, 2008 01:01 PM
There is also one wery nice tool which is GUI for searching packages from the repository and showing package information. Tool is called Debian Package Search, surprising isn't it? :D

If you use Debian Etch or Debian Lenny, here is how you can install the Debian Package Search:

# apt-get install packagesearch

Here is how you can start it from gnome Desktop:
System -> Administration -> Debian Package Search

[Modified by: miksuh on October 30, 2008 01:32 PM]


Searching for package information on Debian and Ubuntu systems

Posted by: miksuh on October 30, 2008 01:41 PM
By the way. Synaptic is not quite as limited as you think. It can show lots of the same package information as apt-cache.

You can search from both package names and descriptions. When you see the search results, click interesting package using right mouse button and select Properties.from the popup menu Package properties window now opens and you can see package dependencies, suggested packages, conflicts, which packages deopend on this package etc.

Ofcourse Synaptic is wery limited when compared to Debian Package Search, which I mentioned in my previous message. But you can do basic searches using Synaptic too.

[Modified by: miksuh on October 30, 2008 02:09 PM]


This story has been archived. Comments can no longer be posted.

Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya