Debian Time Machine
Tuesday, February 10, 2015
I wish there would be a standard tool in Debian or Ubuntu to list all the packages installed since certain date. So that I could use that information to rollback the system state to its original or even a fresh-install state.
Luckily there is a log written with every ever installed, upgraded or removed package by dpkg
or apt-get
, which can be found at /var/log/dpkg.log
. I wrote a simple script that parses the logs and extracts the packages names.
So to list all the packages installed from the beginning of the year:
$ ./dpkg-since.py -n 2015-01-01
Or to clean up the system from anything installed during last two hours:
$ sudo apt-get remove `./dpkg-since.py 2 hours`