Import the key an AUR build needs when signature verification fails
Checked the Makepkg wiki (Signature checking: makepkg uses the user keyring, validpgpkeys, keys/pgp/ subdirectory, --skippgpcheck) and the AUR wiki FAQ entry, and both support the cause and the makepkg parts of the fix. Two things did not hold. First, the fallback keyserver in the fix is hkps://keyserver.ubuntu.com, which is the built-in default of the gnupg 2.4.9-3 installed here (confirmed on this machine with gpgconf --list-options dirmngr and man dirmngr, which says dirmngr uses keyserver.ubuntu.com when none is configured), so the line labelled 'if the default keyserver is unreachable' retries the same server. The GnuPG wiki gives hkps://keys.openpgp.org as the temporary alternative and puts the permanent keyserver line in ~/.gnupg/dirmngr.conf, not gpg.conf. Second, the record ignores what yay does on Omarchy. Read on this machine: /usr/share/omarchy/bin/omarchy-pkg-aur-install, omarchy-pkg-aur-add and omarchy-update-aur-pkgs all run yay with --noconfirm, and yay 13.0.1-1 (installed) ships pgpfetch true and gpgflags empty (yay -Pg). In the v13.0.1 source (pkg/sync/sync.go, pkg/sync/srcinfo/pgp/keys.go, pkg/text/input.go) yay runs gpg --list-keys on every validpgpkeys entry before makepkg and, when --noconfirm is set, ContinueTask returns the preset true so gpg --recv-keys runs without asking. On the Omarchy path a missing key is therefore fetched silently, and the failure a user sees is yay's 'problem importing keys' before makepkg starts, unless the key was imported and still does not verify the tarball, which is the only way the record's makepkg message appears under yay. A grep of every non-test .go file at v13.0.1 found PGPFetch set by the config parser and read nowhere else, so --nopgpfetch likely does not disable the check in yay 13.0.1 (likely, not exercised). Also confirmed: yay's man page documents --mflags with the exact example yay -S foo --mflags "--skipchecksums --skippgpcheck", and yay's clone dir here is ~/.cache/yay (buildDir), so the keys/pgp/ file lives under ~/.cache/yay/foo/. Not exercised: no build was run and no key was fetched on this machine, and paru is not installed here.
--skippgpcheck disables the only check that the upstream tarball is genuinely from the developer. Importing a key ID you found in a random comment rather than in the PKGBUILD's validpgpkeys array defeats the purpose entirely.
Symptom
A makepkg/yay/paru build stops at the source verification stage:
==> Verifying source file signatures with gpg...
foo-1.2.tar.xz ... FAILED (unknown public key ABCDEF0123456789)
==> ERROR: One or more PGP signatures could not be verified!
Cause
makepkg verifies upstream release signatures against YOUR user keyring (~/.gnupg), not pacman's keyring, so this is unrelated to archlinux-keyring. With plain makepkg or paru the upstream developer's public key is simply not in that keyring. With yay (13.x, the helper Omarchy 4 installs) the story is different: pgpfetch is on by default, so before running makepkg yay checks every key in the PKGBUILD's validpgpkeys with gpg --list-keys and offers to gpg --recv-keys the missing ones. Omarchy's own AUR commands (omarchy-pkg-aur-install, omarchy-pkg-aur-add, omarchy-update-aur-pkgs) run yay with --noconfirm, which answers that prompt yes, so on that path a missing key is fetched silently and the usual failure is yay's problem importing keys (keyserver unreachable, or the key is not on it) before makepkg starts. The makepkg message in the symptom appears under yay only when the key was imported and still does not verify the tarball, or when you ran makepkg yourself.
Fix
Read the PKGBUILD's validpgpkeys array to get the exact key ID, then import it. gnupg 2.4 already defaults to hkps://keyserver.ubuntu.com, so name a different server when retrying:
grep validpgpkeys PKGBUILD
gpg --recv-keys ABCDEF0123456789
# if the default keyserver (keyserver.ubuntu.com) fails or lacks the key:
gpg --keyserver hkps://keys.openpgp.org --recv-keys ABCDEF0123456789
To change the keyserver permanently, put it in ~/.gnupg/dirmngr.conf (not gpg.conf):
keyserver hkps://keys.openpgp.org
Some PKGBUILDs ship the key in the repo under keys/pgp/, named by full fingerprint. Import it from there instead. With yay the clone lives in ~/.cache/yay/<pkg>/, with paru in ~/.cache/paru/clone/<pkg>/:
gpg --import keys/pgp/*.asc
Then rebuild:
makepkg -si # or: yay -S foo
Omarchy 4: omarchy-pkg-aur-install and omarchy-pkg-aur-add run yay -S --noconfirm, and yay's pgpfetch default makes it run gpg --recv-keys for missing validpgpkeys without asking. If that step fails you see problem importing keys from yay rather than the makepkg error. Import the key by hand as above, or with the alternative keyserver, then rerun the Omarchy command.
Only if you have independently verified the source and accept the risk, skip the check for one build:
makepkg -si --skippgpcheck
# yay equivalent:
yay -S foo --mflags --skippgpcheck
Verify
gpg --list-keys ABCDEF0123456789 shows the key, and the build proceeds past "Verifying source file signatures".
Sources
- https://wiki.archlinux.org/title/Makepkg
- https://wiki.archlinux.org/title/Arch_User_Repository
- https://wiki.archlinux.org/title/GnuPG
- https://github.com/Jguer/yay/blob/v13.0.1/pkg/sync/srcinfo/pgp/keys.go
- https://github.com/Jguer/yay/blob/v13.0.1/pkg/text/input.go
- https://github.com/Jguer/yay/blob/v13.0.1/pkg/sync/sync.go
- https://github.com/Jguer/yay/blob/v13.0.1/pkg/settings/config.go
- https://github.com/Jguer/yay/blob/v13.0.1/doc/yay.8
- https://github.com/Jguer/yay/releases/tag/v13.0.0
- https://github.com/Morganamilo/paru/blob/master/src/config.rs