Aptitude List Recently Installed

Below is a grep one-liner to look through the logs and find out what was recently installed. Comes in handy if you can't remember what the exact name of that package you installed earlier was.

grep "install\ " /var/log/dpkg.log

This should give you a helpful output in the form below:

root@lambda:~# grep "install\ " /var/log/dpkg.log
2011-07-05 09:17:07 install libpam-modules-bin  1.1.3-2
2011-07-05 09:17:13 install libsane-common  1.0.22-4
2011-07-05 09:17:52 install libqzeitgeist0  0.7.0-1
2011-07-05 09:18:32 install libsane-extras-common  1.0.22.2
2011-07-05 21:55:06 install sendmail-base  8.14.4-2
2011-07-05 21:55:06 install sendmail-cf  8.14.4-2
2011-07-05 21:55:11 install sendmail-bin  8.14.4-2+b1
2011-07-05 21:55:24 install libpq5 9.0.3-1 9.0.4-1+b1
2011-07-05 21:55:24 install sensible-mda  8.14.4-2+b1
2011-07-05 21:55:25 install sendmail  8.14.4-2

You can also replace install with remove to view the recently removed files:

root@lambda:~# grep "remove\ " /var/log/dpkg.log
2011-07-05 09:16:42 remove liblchown-perl 1.01-1+b1 
2011-07-05 21:55:08 remove exim4-config 4.76-2 
2011-07-05 21:55:09 remove exim4-daemon-light 4.76-2 
2011-07-05 21:55:09 remove exim4-base 4.76-2 
2011-07-05 21:55:23 remove exim4 4.76-2 

One thought on “Aptitude List Recently Installed

  1. Thanks. I remove these files with this command:

    aptitude purge `grep "install\ " /var/log/dpkg.log | awk '{ print $4 }'`

Leave a Reply