Merge pull request #29422 from lkxed/20230520-0-Fix--invalid-or-corrupted-package--PGP-signature---Error-In-Arch-Linux

[手动选题][tech]: 20230520.0 ️ Fix “invalid or corrupted package (PGP signature)” Error In Arch Linux.md
This commit is contained in:
Xingyu.Wang 2023-05-21 14:16:19 +08:00 committed by GitHub
commit 93af8e5da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,61 @@
[#]: subject: "Fix “invalid or corrupted package (PGP signature)” Error In Arch Linux"
[#]: via: "https://www.debugpoint.com/invalid-corrupted-package-arch/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
[#]: translator: " "
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Fix “invalid or corrupted package (PGP signature)” Error In Arch Linux
======
**A simple guide to fix the “invalid or corrupted package” error in Arch Linux.**
I have a few Arch Linux systems in both physical and VM setup, which I access when needed. After almost two months, when I tried to upgrade the Arch Linux in one of them using `sudo pacman -Syu`, I got hundreds of errors like this:
![Sample invalid or corrupted package error in Arch Linux][1]
The problem is when you get the above error, you can not upgrade/update your Arch system. Even if you sync the mirrors or get a faster one. So, if you run `sudo pacman -Syyu`, the error will still be there. This is also problematic since you cant install any additional packages until this is fixed.
### Cause
When you install or upgrade packages on an Arch Linux system, pacman checks the digital signatures of the packages against the keys in the `archlinux-keyring` package. This verification process ensures that the packages you download and install are unmodified and come from trusted sources.
It contains the public keyring used to [verify the authenticity and integrity of packages][2] and in pacman. The `archlinux-keyring` package is regularly updated by the Arch Linux developers to include new trusted keys and revoke any compromised keys.
If you have not updated your Arch Linux system for a longer period, then the digital signatures of various packages may mismatch. The changed keys may not match what you have in your system.
Hence the error.
### Fix
To fix “invalid or corrupted package (PGP signature)” error in Arch Linux, you need to install/update the `archlinux-keyring` package from the `Core` repo. Run the following from the terminal:
```
sudo pacman -S archlinux-keyring
```
After the above command is complete, run the upgrade:
```
sudo pacman -Syu
```
This will resolve the problem, and you can continue your normal activity in Arch Linux. Its recommended to always keep the `archlinux-keyring` package up to date to maintain the security and integrity of your Arch Linux system.
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/invalid-corrupted-package-arch/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed/
[1]: https://www.debugpoint.com/wp-content/uploads/2023/05/Sample-invalid-or-corrupted-package-error-in-Arch-Linux.jpg
[2]: https://wiki.archlinux.org/title/Pacman/Package_signing