How to see packages installed on a given date using 'aptitude'?

Unfortunately, dpkg (the package handler aptitude works on top of) does not specifically save the install date of packages, although there's thoughts of adding it. However, the install date can be found by looking at the date stamp of files written to the directory /var/lib/dpkg/info.


I have configured aptitude to write to a log (/var/log/aptitude). It produces output like this;

Aptitude 0.4.11.11: log report
Mon, Feb  9 2009 13:21:28 +0100

IMPORTANT: this log only lists intended actions; actions which fail due to
dpkg problems may not be completed.

Will install 6 packages, and remove 0 packages.
4096B of disk space will be used
===============================================================================
[UPGRADE] apt 0.7.20.1 -> 0.7.20.2
[UPGRADE] apt-utils 0.7.20.1 -> 0.7.20.2
[UPGRADE] base-passwd 3.5.19 -> 3.5.20
[UPGRADE] libgnutls26 2.4.2-5 -> 2.4.2-6
[UPGRADE] libpq5 8.3.5-1 -> 8.3.6-1
[UPGRADE] ucf 3.0015 -> 3.0016
===============================================================================

Log complete.

This shows the exact date and packages that aptitude installed. To configure this, follow the aptitude reference;

Option:Aptitude::Log

Default:/var/log/aptitude

Description: If this is set to a nonempty string, aptitude will log the package
installations, removals, and upgrades that it performs. If the value of
Aptitude::Log begins with a pipe character (ie, ``|''), the remainder of its
value is used as the name of a command into which the log will be piped: for
instance, |mail -s 'Aptitude install run' root will cause the log to be emailed
to root. To log to multiple files or commands, you may set this option to a list
of log targets.

You will find a link to the aptitude reference in the aptitude man page.


There is a simple way to see all packages installation date. Just execute:

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

As a result you will get a list of all installed packages with exact date and time.

Thanks for comments which lead me to that solution.