Pacman: invalid or corrupted package (PGP signature)

I’ve bumped into an issue I can’t seem to find a solution to, running Manjaro Plasma KDE. During my last ‘pacman -Syu’ run, a few packages failed to update due to signature errors:

error: haskell-texmath: signature from "Felix Yan <felixonmars@archlinux.org>" is invalid
:: File /var/cache/pacman/pkg/haskell-texmath-0.12.3.1-12-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: kmail: signature from "Antonio Rojas <arojas@archlinux.org>" is invalid
:: File /var/cache/pacman/pkg/kmail-21.08.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: libreoffice-still: signature from "Felix Yan <felixonmars@archlinux.org>" is invalid
:: File /var/cache/pacman/pkg/libreoffice-still-7.1.6-2-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] 
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

I’ve spent a lot of time trying to figure this one out; I found an archived thread here with a discussion and lots of tips on how to deal with invalid signatures (sorry, unable to post links) and I have tried everything there, including the ‘nuclear option’; removing /etc/pacman.d/gnupg and using pacman-key to initialize and populate a new keyring:

sudo rm -fr /etc/pacman.d/gnupg
sudo pacman-key --init
sudo pacman-key --populate archlinux manjaro
sudo pacman-key --refresh-keys

The exact same signatures fail, again. I tried using gnupg to manually fetch the keys in question, but they seem to be identical to the ones on the key server so I just get a ‘duplicate key’ error.

Thinking it might be a dodgy mirror and the files are actually corrupt, I tried running ‘pacman-mirrors -f0’ to refresh the mirror list and updating again. Same result; the exact same files and signatures fail. So yeah I’ve run out of ideas; anyone experience anything similar?

The packages could be incomplete downloads.

Maybe try changing your mirror and try again:

sudo pacman-mirrors -f5 && sudo pacman -Syyu
1 Like

Hi, Strit

Thanks for the quick answer! Unfortunately I have tried that and it doesn’t help; exact same errors, same packages and the same signatures still fail. The downloaded packages are deleted and re-downloaded with each attempt.

This time I tried intercepting the packages before they are deleted though, and it looks like I’ve made some progress! All three packages fail decompression:

⯈ tar xf /var/cache/pacman/pkg/haskell-texmath-0.12.3.1-12-x86_64.pkg.tar.zst 
/*stdin*\ : Decoding error (36) : Corrupted block detected 
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
⯈ tar xf /var/cache/pacman/pkg/kmail-21.08.2-1-x86_64.pkg.tar.zst            
/*stdin*\ : Decoding error (36) : Corrupted block detected 
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
⯈ tar xf /var/cache/pacman/pkg/libreoffice-still-7.1.6-2-x86_64.pkg.tar.zst   
/*stdin*\ : Decoding error (36) : Restored data doesn't match checksum 
tar: Child returned status 1
tar: Error is not recoverable: exiting now

So looks like I’ve been barking up the wrong tree; the signatures are fine, looks like corrupt packages. Now to find out if they got damaged in transit or are corrupted on the mirror. I’ll do some more digging, thanks.

1 Like

I found the issue; apparently the same mirror got selected each time I refreshed the mirror list and these packages are corrupt or incomplete on this mirror.

::INFO Querying mirrors - This may take some time
  0.206 Norway         : http://mirror.terrahost.no/linux/manjaro/
::INFO Writing mirror list

I ran ‘sudo pacman-mirrors -id’ and manually selected a different mirror from the one I got assigned, re-ran ‘pacman -Syu’ and voila, the packages installed correctly!

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.