archlinux/manjaro-更新报错解决

前言

今天手痒痒,修改了Manjaro系统的时间,然后又用到了pacman,最后导致系统无法安装更新包。

archlinux/manjaro-更新报错解决


论坛解答

If you’re getting an error similar to “Can’t update: signature from *** is marginal trust” or “invalid or corrupted package” you probably just need to update your package signing keys:

sudo pacman -Sy archlinux-keyring manjaro-keyring

sudo pacman-key --populate archlinux manjaro

sudo pacman-key --refresh-keys

If --refresh-keys doesn’t work (for whatever reason) try:

sudo pacman-key --refresh-keys --keyserver pgp.mit.edu

This uses a different keyserver than the default so might work better depending on your internet connection.

If you still can’t update, try updating your package mirrors too, before finally updating all packages:

sudo pacman-mirrors -f0

sudo pacman -Sy archlinux-keyring manjaro-keyring

sudo pacman-key --populate archlinux manjaro

sudo pacman-key --refresh-keys

sudo pacman -Syyu

If you have any other errors, there’s the “nuclear option”:

sudo rm -fr /etc/pacman.d/gnupg

sudo pacman-key --init

sudo pacman-key --populate archlinux manjaro

sudo pacman-key --refresh-keys

sudo pacman -Syyu

If you’re installing an AUR package a PGP key can be used to verify the source files. You will need to import this into your personal keyring before it can be verified. If you don’t you’ll get an error similar to:

[...]

llvm-5.0.0.src.tar.xz ... FAILED (unknown public key 0FC3042E345AD05D)

libcxx-5.0.0.src.tar.xz ... FAILED (unknown public key 0FC3042E345AD05D)

libcxxabi-5.0.0.src.tar.xz ... FAILED (unknown public key 0FC3042E345AD05D)

[...]

To “fix” this, simply import the key:

gpg --recv-key 0FC3042E345AD05D


总结

按照论坛的方法都可以解决,如果是archlinux就需要manjaro-keyring和manjaro的key。

所以系统时间还是不要乱修改,最好是有做时间同步,矫正好时间再去使用pacman进行包安装。

相关推荐