Skip to content

Instantly share code, notes, and snippets.

@ictus4u
Created March 14, 2023 05:02
Show Gist options
  • Save ictus4u/a5b42f5f7861859a7582ab0befc980d4 to your computer and use it in GitHub Desktop.
Save ictus4u/a5b42f5f7861859a7582ab0befc980d4 to your computer and use it in GitHub Desktop.
Get separate files with the keys contained in /etc/apt/trusted.gpg keyring
gpg -k --no-default-keyring --keyring /etc/apt/trusted.gpg | \
grep '^ ' | \
tr -d ' ' | \
grep -Eo '.{8}$' | \
while read fingerprint; do
((++i));
gpg \
--export \
--output /tmp/${i}-archive-keyring.gpg \
--yes \
--no-default-keyring \
--keyring /etc/apt/trusted.gpg \
${fingerprint} ;
gpg -k --no-default-keyring --keyring /tmp/${i}-archive-keyring.gpg ;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment