apt-get state of packages

on

Just wanted to know what the current state of the packages is on my Ubuntu machine.

So I installed apt-show-versions:

knilluz@server:~$ sudo apt-get install apt-show-versions

Now running this apt-show-versions gives al long list of all packages an their state.

knilluz@server:~$ apt-show-versions
adduser/maverick uptodate 3.112ubuntu1
apache2/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
apache2-mpm-prefork/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
dbus/maverick-updates uptodate 1.4.0-0ubuntu1.2
debconf/maverick uptodate 1.5.32ubuntu3
debconf-i18n/maverick uptodate 1.5.32ubuntu3
debianutils/maverick uptodate 3.2.3
....

This is a long list, so first get a summary:

knilluz@server:~$ apt-show-versions | cut -d " " -f 2 | sort | uniq  -c
 120 upgradeable
 364 uptodate

That’s a nice list. But now try to split the upgradeables into security upgrades and ‘normal’ upgrades. Here is the -u option handy

knilluz@server:~$ apt-show-versions -u | cut -d '/' -f 2 | cut -d ' ' -f 1 | sort | uniq -c
 65 maverick-security
 55 maverick-updates

Ok that’s some nice cutting  piping and sorting. So 65 security updates. Hmm let’s list them:

knilluz@server:~$ apt-show-versions -u | grep security
apache2/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
apache2-mpm-prefork/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
apache2-utils/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
apache2.2-bin/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
apache2.2-common/maverick-security upgradeable from 2.2.16-1ubuntu3 to 2.2.16-1ubuntu3.1
..

Time to do an apache upgrade

knilluz@server:~$ sudo apt-get install apache2