1

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.

Maroloccio
  • 125
  • 5

2 Answers2

1

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

Example:

$ 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.*

Note:

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.

raphink
  • 11,337
  • 6
  • 36
  • 47
0

It's not exactly what you want, but

aptitude show packagename | grep ^Description:

should do the trick.

Sven
  • 97,248
  • 13
  • 177
  • 225