Skip to content

Instantly share code, notes, and snippets.

@gene1wood
Last active April 29, 2024 03:41
Show Gist options
  • Save gene1wood/a4a9f134052edde4edc0e56969f2d5ed to your computer and use it in GitHub Desktop.
Save gene1wood/a4a9f134052edde4edc0e56969f2d5ed to your computer and use it in GitHub Desktop.
Command to remove all apt gpg keys in /etc/apt/keyrings from /etc/apt/trusted.gpg
for keyfile in /etc/apt/keyrings/*.asc; do echo "$keyfile"; cat "$keyfile" | gpg --with-colons --import-options show-only --import | awk -F: '$1 == "fpr" {print $10}' | xargs --verbose -L 1 apt-key del; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment