Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

To just get the package description and/or "long description" of a Mac port, I can do this:

port info --description --long_description vim

and filter out information I don't need.

How can I do so in Ubuntu?

I have read the manual pages for the dpkg series as well as apt-cache and similar but I could find no fine-grained control on fields returned from the metadata database such as the above.

Is there an option on a command I missed? Should I resort to parsing and cutting the output?

In particular, I need the "long description" as a one-liner.

share|improve this question
up vote 1 down vote accepted

grep-aptavail and friends (grep-dctrl and grep-available, to find this information respectively in specific Packages files or in the dkpg base of locally installed packages) are the most precise tools for that:

grep-aptavail -s Description -PX packagename


$ grep-aptavail -PX 'apache2' -s Description
Description: Apache HTTP Server metapackage
 The Apache Software Foundation's goal is to build a secure, efficient and
 extensible HTTP server as standards-compliant open source software. The
 result has long been the number one web server on the Internet.
 It features support for HTTPS, virtual hosting, CGI, SSI, IPv6, easy
 scripting and database integration, request/response filtering, many
 flexible authentication schemes, and more.*


Debian (and Ubuntu) packages have two parts in their description:

  • the first line of the Description field is the short description, which appears in apt-cache search packagename;
  • the rest of the Description field (beginning with the second line) is the long description.

For this reason, you can get the short description as a one-liner, but the long description is by definition spread on several lines.

share|improve this answer
Indeed, as you say, these are the most precise tools to get the intended output. Perfect, thank you. – Maroloccio May 26 '11 at 12:18

It's not exactly what you want, but

aptitude show packagename | grep ^Description:

should do the trick.

share|improve this answer
No, thanks but this is not what I am looking for. – Maroloccio May 26 '11 at 12:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.