Arch Linux: fetch a missing or unknown GPG key
Two gpg commands to fetch a missing public key: WKD lookup by e-mail and receive by key ID.
On Arch Linux, a "GPG key not found or unknown" error appears when a signature cannot be verified because the public key is missing from the keyring. Two commands can fetch it.
gpg --auto-key-locate nodefault,wkd --locate-keys user@example.com
sudo gpg --recv-key <KEY_ID>
- The first looks up the key tied to an e-mail address through the Web Key Directory (WKD), without using a keyserver (
nodefault,wkd). - The second downloads the public key with ID
<KEY_ID>from the configured keyserver.sudoimports it into root's keyring, which some system tools use.
Check the received key's fingerprint against a trusted source before trusting it.