Debian Tools: apt-show-versions
I often want to see what packages I have installed on a debian system. Also I like to see what are the upgrades available. This can be achieved with apt-show-versions that does them both: list all the packages installed and their respective version and also it can show what are the upgrades available and their version.
apt-show-versions is not automatically installed so we have to install it first:
aptitude install apt-show-versions
Now, if I want to see all the packages installed and their version I will run it without any parameter (maybe you will want to pipe the command with more or output it to a file as the list will be probably quite large):
apt-show-versions |more
php4-gd/stable uptodate 4:4.3.10-16
groff-base/etch uptodate 1.18.1.1-12
m4/etch uptodate 1.4.4-1
libmysqlclient15off/etch uptodate 5.0.20-1
ncftp/etch uptodate 2:3.1.9-1
...
As you can see the list is not sorted so maybe it will be useful to sort the output:
apt-show-versions |sort |more
acpid/etch uptodate 1.0.4-5
adduser/etch uptodate 3.87
apache2-common/etch uptodate 2.0.55-4
apache2-mpm-prefork/etch uptodate 2.0.55-4
apache2-prefork-dev/etch uptodate 2.0.55-4
apache2-utils/etch uptodate 2.0.55-4
apt/etch uptodate 0.6.43.3
...
If I want to see the available upgrades I will have to just include the -u parameter:
apt-show-versions -u
php4-pgsql/etch upgradeable from 3:4.3.10-4 to 4:4.4.2-1+b1
php4-interbase/etch upgradeable from 4.3.10-2 to 4:5.1.2-1
php4-imagick/etch upgradeable from 0.9.11-0.2 to 4:0.9.11+1-2
...
Tags: apt, apt-show-versions, Debian, debian_tools
Share This







22nd May 2006, 15:35
Doesn’t work in Ubuntu though
22nd May 2006, 16:09
Alan,
What happens? Please paste some text of the error you are seeing and I might be able to help you.
18th June 2006, 14:54
Marius,
Is there a way to list installed packages sorted by the time of installation, with the most recently installed being the last in the list?
Thanks.
Chandra
18th June 2006, 17:59
Chandra,
From what I know there is no tool available to provide the information you are looking for. Here are some ideas that might be useful to you on this matter:
- each action (upgrade/install/remove) is recorded normally in logs. If you just want to see when one particular package was installed you might look into the logs (/var/log/dpkg.log should contain all actions regardless of the tool used to install the packages apt-get, aptitude, etc.)
- another idea is to use the dpkg info files and sort them by date. Still this will not give you the time of installation, but the time that the package was build. For example you can list all the md5sum files for each package from /var/lib/dpkg/info to achieve this…
cd /var/lib/dpkg/info/
ls -al -t *.md5sums
will give something like:
-rw-r–r– 1 root root 929 Jun 14 13:49 apt-utils.md5sums
-rw-r–r– 1 root root 12023 Jun 14 13:49 apt.md5sums
-rw-r–r– 1 root root 62 Jun 14 03:30 php4-gd.md5sums
-rw-r–r– 1 root root 65 Jun 14 03:30 php4-mysql.md5sums
-rw-r–r– 1 root root 69 Jun 14 03:30 libapache2-mod-php4.md5sums
-rw-r–r– 1 root root 110 Jun 14 03:30 php4-cli.md5sums
-rw-r–r– 1 root root 1434 Jun 14 03:30 php4-common.md5sums
-rw-r–r– 1 root root 390 Jun 13 00:03 mkvmlinuz.md5sums
-rw-r–r– 1 root root 534 Jun 12 07:06 x11-common.md5sums
-rw-r–r– 1 root root 820 Jun 10 00:39 libxslt1.1.md5sums
…
These are all the ideas I could think of at this time… I hope this will help you.
24th July 2006, 19:25
google for dpkg.log (found at /var/log/) and apt-history. this will solve your problem!
2nd July 2007, 00:20
@Chandra - It’s not quite so neatly sorted as just a list of package names, but if you use aptitude, it’s log lists all packages installed in chronological order. You can run through it (/var/log/aptitude) with less or another pager and get the info you need.