Remove todays debian installed packages

When you change your mind or you have installed packages on wrong server this magic command can help:


grep -e `date +%Y-%m-%d` /var/log/dpkg.log | awk '/install / {print $4}' | uniq | xargs apt-get --purge -y remove

Purge config files of removed packages:


aptitude purge `dpkg --get-selections | grep deinstall | awk '{print $1}'`

Leave a Reply

Your email address will not be published. Required fields are marked *