Skip to content

Instantly share code, notes, and snippets.

@nonohry
Created December 6, 2020 11:13
Show Gist options
  • Save nonohry/e46cea8e8c54371d39246a2eafa7f500 to your computer and use it in GitHub Desktop.
Save nonohry/e46cea8e8c54371d39246a2eafa7f500 to your computer and use it in GitHub Desktop.
Remove all packages installed after a certain date/time
Specific date %d-%m-%d replace on here,
grep "2020-12-9.*.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 "2020-12-9.*.install " /var/log/dpkg.log | awk '{ print $4 }' | cut -d: -f1 | xargs sudo apt-get --yes purge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment