Skip to content

Instantly share code, notes, and snippets.

@jadams
Created January 24, 2021 15:38
Show Gist options
  • Save jadams/5a214f8591a4742c2df97cb58d421d49 to your computer and use it in GitHub Desktop.
Save jadams/5a214f8591a4742c2df97cb58d421d49 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
grep $1 /var/log/apt/history.log | mawk '/Install:.*/{gsub(":amd64 [(][^)]*[)][,]?","");gsub("^Install: ","apt purge ");print}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment