Arch Linux 升级系统提示签名无效

SMJ

今天升级系统的时候,竟然升级失败了,提示:

error: PackageName: signature from "User <email@archlinux.org>" is invalid
error: failed to commit transaction (invalid or corrupted package (PGP signature))
Errors occurred, no packages were upgraded.

我瞬间懵逼了,因为是第一次碰到这个问题,用了这么久,从未出现过这个问题,所以就马上 Google 类似问题
发现是 keyring 的问题,所以就试着直接先更新 keyring

sudo pacman -Sy archlinux-keyring

然而并没有什么卵用,然后在 archlinux 的论坛找到了一个和我完全一样问题的答案,直接重置所有 cache 然后重置pacman-key

sudo pacman -Sc
sudo rm -r /etc/pacman.d/gnupg
sudo pacman-key --init
sudo pacman-key --populate
sudo pacman -Sy archlinux-keyring
sudo pacman -Syu

reference

https://wiki.archlinux.org/title/Pacman/Package_signing#Troubleshooting

Sooner or later, everything ends.