Created
March 14, 2023 05:02
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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