执行 pacman -Syu 时错误信息如下:
error: lib32-alsa-lib: signature from "Felix Yan <felixonmars@gmail.com>" is invalid
:: File /var/cache/pacman/pkg/lib32-alsa-lib-1.1.0-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n]
反正就是类似这种说签名不可用,
/var/cache/pacman/pkg/libx32-flex-2.6.0-1.1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
问你是否删除,若选择是,再升级还会重新下载,仍旧那样,选择否直接退出无法升级。
官方wiki说系统时间不正确会导致这个问题:
Signature from "User <email@gmail.com>" is unknown trust, installation failed
Follow pacman-key#Resetting all the keys. Or you can try to either:
update the known keys, i.e.
pacman-key --refresh-keys
;or manually upgrade archlinux-keyring package first, i.e.
pacman -S archlinux-keyring
.Request on importing PGP keys
If installing Arch with an outdated ISO, you are likely prompted to import PGP keys. Agree to download the key to proceed. If you are unable to add the PGP key successfully, update the keyring or upgrade archlinux-keyring (see above).
Signature from "User <email@archlinux.org>" is invalid, installation failed
When the system time is faulty, signing keys are considered expired (or invalid) and signature checks on packages will fail with the following error:
error: package: signature from "User <email@archlinux.org>" is invalid error: failed to commit transaction (invalid or corrupted package (PGP signature)) Errors occured, no packages were upgraded.
Make sure to correct the time, for example with
ntpd -qg
run as root, and runhwclock -w
as root before subsequent installations or upgrades.
若是多系统可能容易出现这个情况,但我重置了时钟,还是有报错。
还有的解决办法是更改 pacman.conf 里面的
将 SigLevel = PackageRequired改成如下:
SigLevel = Never
我的系统改了也不行,还把 pacman.conf 文件改乱了。。。以后改重要文件是一定要先备份 cp foo foo.bak
这里贴一个范例,供改坏之后参考:
[options]
NoUpgrade = etc/passwd etc/group etc/shadow
NoUpgrade = etc/fstab
Architecture = x86_64
[core]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
[extra]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
#[community-testing]
#SigLevel = PackageRequired
#Include = /etc/pacman.d/mirrorlist
[community]
SigLevel = PackageRequired
Include = /etc/pacman.d/mirrorlist
# 如果打算在 x86_64 系统上运行32位软件,启用 multilib 软件仓库。
#[multilib-testing]
#SigLevel = PackageRequired
#Include = /etc/pacman.d/mirrorlist
#[multilib]
#SigLevel = PackageRequired
#Include = /etc/pacman.d/mirrorlist
# 自定义软件仓库实例,如何创建软件仓库参见 pacman man手册页。
#[custom]
#SigLevel = Optional TrustAll
#Server = file:///home/custompkgs
[archlinuxcn]
SigLevel = Optional TrustedOnly
Server = http://repo.archlinuxcn.org/$arch
解决方法:
最后看到了这个帖子,救命贴 :P, 得到解决办法如下:
rm -R /etc/pacman.d/gnupg/ # 删除gnupg目录及其文件
pacman-key --init
pacman-key --populate archlinux
pacman-key --populate archlinuxcn # 启用了archlinux中文软件库的还要执行这个
更新,升级,妥妥的 :)
福利:一个好用的google镜像站 https://suche.web.de/