Created
March 1, 2019 14:25
Fix: Public Key of Ultimately Trusted Key $key Not Found
This file contains 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 | |
gpg --check-trustdb 2>&1| grep 'not found' | awk '{print $8}' >bad-keys.txt | |
gpg --export-ownertrust > ownertrust-gpg.txt | |
mv ~/.gnupg/trustdb.gpg ~/.gnupg/trustdb.gpg-broken | |
for KEY in `cat bad-keys.txt` ; do sed -i "/$KEY/d" ownertrust-gpg.txt ; done | |
gpg --import-ownertrust ownertrust-gpg.txt | |
rm bad-keys.txt ownertrust-gpg.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment