List your installed package versions with apt-show-versions

apt-show-versions parses the dpkg status file and the APT lists for the installed and available package versions and distribution and shows upgrade options within the specific distribution of the selected package.

This is really useful if you have a mixed stable/testing environment and want to list all packages which are from testing and can be upgraded in testing.

apt-show-versions uses caching for the status information of installed and available packages. If you run apt-show-versions as root the cache is updated as needed. If you run as non-root uses the newest available information, but can’t update the cache. If you run as root with the option -i the cache is initialized or updated only.

Install apt-show-versions in Debian

#apt-get install apt-show-versions

Install apt-show-versions in Ubuntu

sudo apt-get install apt-show-versions

Examples

If you want to run this command from the command line

#apt-show-versions

output looks like below

libdb1-compat/testing uptodate 2.1.3-9
libhtml-mason-perl/testing uptodate 1:1.33-2
libmailtools-perl/testing uptodate 1.74-0.1
libfile-scan-perl/testing uptodate 1.43-1
liborbit2/testing upgradeable from 1:2.14.0-2 to 1:2.14.3-0.1
discover1/testing uptodate 1.7.18
auto-apt/testing uptodate 0.3.21
mutt/testing uptodate 1.5.13-1
egroupware-phpsysinfo/testing upgradeable from 1.2-104.dfsg-3 to 1.2-105.dfsg-2
libssl0.9.8/testing upgradeable from 0.9.8b-3 to 0.9.8c-3
libgtk2.0-0/testing upgradeable from 2.8.20-1 to 2.8.20-3

If you want to see available upgraded you need to use -u option

#apt-show-versions -u

output looks like

ruby1.8/testing uptodate 1.8.5-3
bsdmainutils/testing uptodate 6.1.4
libtime-modules-perl/testing uptodate 2003.1126-2
slang1a-utf8 1.4.9dbs-8 installed: No available version in archive
tmpreaper/testing uptodate 1.6.6
eject/testing uptodate 2.1.4-2.1
ssh/testing upgradeable from 1:4.3p2-3 to 1:4.3p2-5

To get a list of all available versions of libc6

#apt-show-versions -a -p libc6

To upgrade all packages in testing:

#apt-get install ‘apt-show-versions -u -b | fgrep testing’

If you want to know more available options for apt-show-versions check man page

Sponsored Link

2 thoughts on “List your installed package versions with apt-show-versions

  1. The last command that let’s you upgrade all the packages in testing doesn’t work. I think we should enclose the whole ‘apt-show-versions -u -b | fgrep testing’ part in command substitutions quotes/ticks (`).

    Cheers

    –arky

Leave a comment

Your email address will not be published. Required fields are marked *