Pacman update error, corrupted packages

Hello! I have a problem with pacman doing system update. I have done all of the common fixes for pacman signature errors but nothing has worked this far.

I have also tried to delete the signatures by ID, then repopulate but no dice.

I still get these errores in 2 packages.

Total Installed Size: 4640,78 MiB
Net Upgrade Size: 94,91 MiB

:: Proceed with installation? [Y/n] y
(341/341) checking keys in keyring [############################] 100%
(341/341) checking package integrity [############################] 100%
error: dolphin: signature from “Antonio Rojas arojas@archlinux.org” is invalid
:: File /var/cache/pacman/pkg/dolphin-22.04.2-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: llvm: signature from “Evangelos Foutras evangelos@foutrelis.com” is invalid
:: File /var/cache/pacman/pkg/llvm-13.0.1-6-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] n
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.

Any ideas? — Problem fixed.

If anyone has problems with pacman update and you have tried everything, try this:
sudo pacman -Sc

try this:
sudo pacman-key --refresh-keys
it could take some time, and ignore the gpg errors if any

2 Likes

Thanks for the reply, However for me one command fixed it.

sudo pacman -Sc
after that my system updated. Thank god. :slight_smile:

This just shows that you have no idea what you are doing, ie. what any of the commands does. You did same thing which you answered ‘no’ to in the first post.

1 Like

No. pacman -Sc remove all the packages. "Remove all target packages, as well as all packages that depend on one or more target packages. This operation is recursive and must be used with care, since it can remove many potentially needed packages. "

  1. If you mean that rm command that has been use in the arch wiki, then this did not work for me.

  2. sudo pacman-key --refresh-keys and what i did are definitely doing different things…

So in my case there error was not resolved with fixing the signatures, but also removing the packages that were on the system.

Where are you getting this description?

From man pacman:

       -c, --clean
           Remove packages that are no longer installed from the cache as well as
           currently unused sync databases to free up disk space. When pacman downloads
           packages, it saves them in a cache directory. In addition, databases are saved
           for every sync DB you download from and are not deleted even if they are
           removed from the configuration file pacman.conf(5). Use one --clean switch to
           only remove packages that are no longer installed; use two to remove all files
           from the cache. In both cases, you will have a yes or no option to remove
           packages and/or unused downloaded databases.

Since I was not on my computer, I pulled this from Arch Wiki page. I usually use man too.

You probably read wiki for -c in combination with -R. I know, pacman flags can be confusing.

I am getting used to the Arch eco system and have enjoyed my time in Manjaro. I am relative noob on Arch based systems but I have learned quite a lot this year and took an entry level course on Linux systems where I basically relyed on terminal commands for 1 month doing C code on the side. What I am getting at is that I have been using Debian based distros like Ubuntu, Linux mint for years but had very little understanding of the underlying system but I have learned a ton this year mostly on Manjaro.

In pacman, multiple operations (-R,–remove | -S, --sync | -Q, --query), support the -c option. @aegir221 quote is for -R | --remove operation. @zbe quote is for the -S | --sync operation.

I always search the pacman manpage for the operation to get positioned on the operation’s options.

A side notes,
Sometimes it helps to delete the individual downloaded package(s) in /var/cache/pacman/pkg when “corrupted”.

There is a systemd timer pamac-cleancache.timer, that executes pamac clean the first Sat of every month to perform regular maintenance on the package cache.