Ubuntu – How to one remove all packages installed after a certain date/time

package-managementuninstall

On the 9th of November I tried installing the last stable release of BasKet Note Pads which apparently is not supported off the bat because it needs to be ported to QT4 and KDE 4, whatever that means. The program has been ported but it is, as of 2010, in beta phase meaning it is basically buggy and lacks the functionality that I need.

As such, I tried installing BasKet v1.x which needed QT3 and a bunch of other things I don't know much about. I tried installing them and ended up filling 20% of my 15 GB hard drive. Of course, I never got BasKet to work but the packages I installed are still there and now I need to effectively uninstall everything I installed that day.

Is there a command to uninstall all packages installed on a certain date (in my case, the 9th of November) ?

Best Answer

Specific date %yyyy-%mm-%dd replace on here,

grep "2015-12-19.*.install " /var/log/dpkg.log | awk '{ print $4 }' | cut -d: -f1

You get a list of packages,

libck-connector0
libgssrpc4
libkadm5clnt-mit9
libkdb5-7
libkadm5srv-mit9
libgnutlsxx27
....
....

Append them to the list of Apt command arguments with xargs:

grep "2015-12-19.*.install " /var/log/dpkg.log | awk '{ print $4 }' | cut -d: -f1 | xargs sudo apt-get --yes purge