Get package description using apt

Solution 1:

If you would just use apt-cache search package-name, all packages with "package-name" in it would be returned. To limit to a package named "package-name", use:

apt-cache search ^package-name$

Solution 2:

You can do this with aptitude as in:

aptitude show package-name

See also Is aptitude still considered superior to apt-get?

Solution 3:

apt-cache show <packagename> does what you want. You might have overseen it. The following command highlights it:

apt-cache show scons | grep --color -E "Description|$"

Solution 4:

Assuming you are looking for a specific package, I believe the following is what you are in search of:

apt-cache search some-pkg

If I have misunderstood what you are trying to do, please let me know.

Solution 5:

Lekensteyn answer is great to get the short description. Extending Martin's answer you can get also the larger multi-line description (also in other languages):

apt-cache show figlet toilet | grep -E "^Package|^Description-en|^ "

If you use this a lot you can add this function to your .bashrc/.zshrc:

apt-desc() { apt-cache show "$@" | grep -E "^Package|^Description-en|^ "; }

For a normal case just use the friendlier apt show.