Error “error: failed to commit transaction (invalid or corrupted package)” (SOLVED)
December 7, 2022
When using pacman while updating packages, for example
sudo pacman -Syu
An error may occur:
error: binutils: signature from "Frederik Schwan <frederik.schwan@linux.com>" is unknown trust :: File /var/cache/pacman/pkg/binutils-2.39-4-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)). Do you want to delete it? [Y/n]
If you choose the proposed option – remove an invalid or damaged package – then the update will fail with the following error:
error: failed to commit transaction (invalid or corrupted package) Errors occurred, no packages were upgraded.
The specific error message in your case may be different, for example, another package may be invalid or corrupted, or the PGP signature may belong to another person.
In any case, to fix the error, start by reinstalling the archlinux-keyring package:
sudo pacman -S archlinux-keyring
After that, the system update should pass without error.
sudo pacman -Syu
Related articles:
- pacman error “warning: failed to retrieve some files” (SOLVED) (100%)
- How to completely uninstall a package along with dependencies on Arch Linux (as well as BlackArch and Manjaro) (97.5%)
- How to view package information in Arch Linux (BlackArch, Manjaro) (97.5%)
- How to download a package without installation in Arch Linux and Manjaro. How to download the AUR package source code (97.5%)
- Analogue of the --force option in pacman (86%)
- PHP Warning: PHP Startup: imap: Unable to initialize module (SOLVED). How to install the imap module for PHP on Arch Linux (RANDOM - 50%)