While working to verify some packages in Ubuntu 12.04 had backport patches installed properly I needed to list installed package versions. To do this you can install a package called apt-show-versions which will allow you to list all installed packages and their versions with ease. This likely works on most Ubuntu versions but was tested on Ubuntu 12.04 also know as Precise Pangolin and Ubuntu 12.10 also known as Quantal Quetzal. Follow the instructions below to install apt-show-versions and then list all installed packages and their versions.
Install apt-show-versions On Ubuntu To List Package Versions:
- root@dev:/etc/apache2# apt-get install apt-show-versions
- Reading package lists... Done
- Building dependency tree
- Reading state information... Done
- The following extra packages will be installed:
- The following NEW packages will be installed:
- apt-show-versions libapt-pkg-perl
- 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
- Need to get 115 kB of archives.
- After this operation, 420 kB of additional disk space will be used.
- Do you want to continue [Y/n]? Y
- Get:1 http://azure.archive.ubuntu.com/ubuntu/ quantal/main libapt-pkg-perl amd64 0.1.26 [81.8 kB]
- Get:2 http://azure.archive.ubuntu.com/ubuntu/ quantal/universe apt-show-versions all 0.19+nmu1 [33.5 kB]
- Fetched 115 kB in 0s (263 kB/s)
- Selecting previously unselected package libapt-pkg-perl.
- (Reading database ... 56372 files and directories currently installed.)
- Unpacking libapt-pkg-perl (from .../libapt-pkg-perl_0.1.26_amd64.deb) ...
- Selecting previously unselected package apt-show-versions.
- Unpacking apt-show-versions (from .../apt-show-versions_0.19+nmu1_all.deb) ...
- Processing triggers for man-db ...
- Setting up libapt-pkg-perl (0.1.26) ...
- Setting up apt-show-versions (0.19+nmu1) ...
- ** initializing cache. This may take a while **
Now that the package is installed you should be able to list the Ubuntu installed package versions as shown in the below example.
List Installed Package Versions In Ubuntu 12.04:
- root@dev:/etc/apache2# apt-show-versions
The above example has many of the results filtered out but you now should be able to list Ubuntu 12.04 package versions with ease. To list a single package version such as Apache2 you could use grep as shown in the below example.
List Single Package Version Ubuntu 12.04:
- root@dev:/etc/apache2# apt-show-versions | grep apache2\/
- apache2/quantal-security uptodate 2.2.22-6ubuntu2.3
| | | |