Ubuntu – Packages installed within a certain time frame

package-managementtime

Could someone please help me with how I can list the packages that were manually installed within a certain time frame. For instance, If I want to see a list of packages that were manually installed in the past 2 months..how may I go about doing it?

Than you

Best Answer

This is a script using aptitude (to be installed) and dpkg logs,
change the date variable, in format YYYY-MM-DD:

#!/bin/bash

export LC_COLLATE=C

date="2011-05-31"

join -22\
  <(aptitude -F%p search '?installed?not(?automatic)' |
    sort) \
  <(less /var/log/dpkg.log* |
    sort |
    awk -v date="$date" '$1 >= date && $3 == "install" { print $1, $4 }' |
    sort -u -k2,2) |
  awk '{ print $2, $1 }' |
  sort