pacman更新时报错 signature is invalid

执行 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 run hwclock -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/




转载于:https://my.oschina.net/sukai/blog/603638

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值