apt-cache dump --installed doesn't work, it lists uninstalled packages as well.

I want to list the install packages each by one line, with the installed version number.

link|improve this question

feedback

3 Answers

up vote 3 down vote accepted

try dpkg -l

it lists you the packages, version and a short description.

link|improve this answer
feedback

Simplest, but might show a few extraneous packages and truncates long package names and version numbers:

dpkg -l

To list only correctly installed packages and not truncate names:

dpkg -l | grep '^ii'

To get more control over the output format, you can use dpkg-query:

dpkg-query -W -f '${status} ${package} ${version}\n' |
sed -n 's/^install ok installed //p'
link|improve this answer
feedback

To list the names of each installed package, type as a superuser :

dpkg --get-selections

You will get an output like this :

accountsservice              install
aclinstall                   install
acpi-supportinstall          install
acpidinstall                 install
...

To remove the unecessary "install" character string, you can use sed :

dpkg --get-selections | sed 's:install$::'

And if yout want to save it to a file called InstalledPackages, you type this :

dpkg --get-selections | sed 's:install$::' > InstalledPackages
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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