Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I know that entering

dpkg --get-selections "*" >pkg.list 

gives a listing of the packages, but I would also like a brief explanation/description of what each of those packages does. Is there a way to generate such a description?

share|improve this question

My thought for SO many packages would be first to create a variable with them:

The following will create the packages variable and assign all packages that dpkg outputs. packages=$(dpkg --get-selections '*' | grep 'install' | cut -f1)

You can further limit this by adding an additional grep at the end, for example:

packages=$(dpkg --get-selections '*' | grep 'install' | cut -f1| grep 'wine')

will output all wine packages. This is only if you want to only see a specific package.

After this we then use FOR to start parsing all packages in the "packages" variable:

for pack in $packages ; do apt-cache showpkg $pack; done

This will give us a LOT of information for each package found. If you are a fan of aptitude then you can use aptitude to show the information in a more human friendly way:

for pack in $packages ; do aptitude show $pack; done

If you are happy with the output you can further output this into a file:

for pack in $packages ; do aptitude show $pack >> packages.txt; done

A copy/paste version of all of this would be:


packages=$(dpkg --get-selections '*' | grep 'install' | cut -f1)
for pack in $packages ; do aptitude show $pack; done

APT-GET Version

packages=$(dpkg --get-selections '*' | grep 'install' | cut -f1)
for pack in $packages ; do apt-cache showpkg $pack; done

If you do all packages, it will take some time for them to be included in the file as output.

share|improve this answer

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.