Apt-cache: How to list all installed packages with version number?

try dpkg -l

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


The simplest way is using dpkg, but it might show a few extraneous packages and it 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'

Other command can be:

apt-show-versions

It also gives you info about the package state (up to date, upgradable, ...) and about the origin distribution (wheezy, jessie, ...). One can easily filter out packages which came from backports or other exotic repositories.

This program is packaged separately. Install it first with:

apt-get install apt-show-versions