Created
May 9, 2023 13:00
-
-
Save zeroday0619/894c271626856635617a563713fba0aa to your computer and use it in GitHub Desktop.
legacy 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
| #!/bin/bash | |
| # https://askubuntu.com/questions/1407632/key-is-stored-in-legacy-trusted-gpg-keyring-etc-apt-trusted-gpg | |
| for KEY in $( \ | |
| apt-key --keyring /etc/apt/trusted.gpg list \ | |
| | grep -E "(([ ]{1,2}(([0-9A-F]{4}))){10})" \ | |
| | tr -d " " \ | |
| | grep -E "([0-9A-F]){8}\b" \ | |
| ); do | |
| K=${KEY:(-8)} | |
| apt-key export $K \ | |
| | sudo gpg --dearmour -o /etc/apt/trusted.gpg.d/imported-from-trusted-gpg-$K.gpg | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment