34

I am running sudo pacman -Syu on my Arch Linux and I am getting the following:

cristian@localhost:~$ sudo pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 xenlism-arch is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...
error: failed to prepare transaction (could not satisfy dependencies)
:: package-query: requires pacman<4.3

What's the solution to fix this?

UPDATE

I have tried both solutions sugested by @jham. I have completely removed yaourt and package-query. At pacman -Qi pacman at 'required by' I have none. I also commented multilib and xenlism-arch from pacman.conf. When I do pacman -Syu I get the following:

:: Proceed with installation? [Y/n] 
(244/244) checking keys in keyring                              [###################################] 100%
(244/244) checking package integrity                            [###################################] 100%
error: confuse: signature from "Thorsten Töpper <atsutane@freethoughts.de>" is unknown trust
:: File /var/cache/pacman/pkg/confuse-2.8-2-x86_64.pkg.tar.xz 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.
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Cristian
  • 1,590
  • 5
  • 23
  • 38
  • 1
    Do you have package-query and yaourt installed? If yes, you probably have a conflict with package-query. Try `yaourt -S package-query` and then start upgrade with pacman again. Afterwards you will need to rebuild your package-query, since it probably won't be compatible with the new pacman. – jham Feb 07 '16 at 10:51
  • 1
    Generally, looks like there is a package installed locally which is not managed in the official archlinux repository). You can check which packages require your currently installed pacman version with `pacman -Qi pacman` (look for "Required By" section in the output). A good start to see then whether any of the packages listed occure in the list of locally installed packages (eg. over yaourt) with `pacman -Qm`. If you find one, then remove that package and try upgrade with pacman again. Also possible, there is a conflict with a package from multilib or xenlism-arch repository you have added. – jham Feb 07 '16 at 11:10
  • I have updated the initial question with the current situation after I have tried your solutions jham. Please check it out. Thank you. – Cristian Feb 07 '16 at 12:51
  • 2
    `yaourt -S package-query` did the trick for me. – Bernhard Fürst Feb 08 '16 at 11:04
  • only https://aur.archlinux.org/packages/package-query-git is left now. package-query itself no longer exists. – dotbit Nov 04 '18 at 03:19

7 Answers7

60

I just had this very same error. The problem seems to be that there are new keys in the archlinux-keyring package, and new packages (confuse) signed with those keys. Since both packages are updated in the same transaction, well the new keys cannot be used until the update is finished, but the transaction will not start until the packages are checked...

The solution would be to update the archlinux-keyring by itself:

pacman -S archlinux-keyring

And then do the rest:

pacman -Su

If that fails, you could try running through the keys manually, with:

pacman-key --populate

but usually, it is not necessary.

rodrigo
  • 94,151
  • 12
  • 143
  • 190
7

I just happened to have the same problem, and solved it the following way:

$ sudo pacman -Rdd package-query # Purge the conflicting package-query
$ sudo pacman -Syu               # There it works

# Now reinstall package-query
$ git clone https://aur.archlinux.org/package-query.git
$ cd package-query && makepkg -si
2

For anyone else coming in here that didn't find the solution by rorido working, try users Bernhard Fürst's or Jham's answer of just pacman -S package-query which worked for me without issues.

Also, if you are still getting issues like this with libalpm.so.8: cannot open shared object file: No such file or directory then you have to manually reinstall package-query and yaourt.

sudo pacman-db-upgrade
yaourt -R package-query yaourt

git clone https://aur.archlinux.org/package-query.git
cd package-query
makepkg -si
cd ..
git clone https://aur.archlinux.org/yaourt.git
cd yaourt
makepkg -si
cd ..
hak8or
  • 488
  • 2
  • 9
  • 28
2

If you still have an error. Try this:

sudo find /var/cache/pacman/pkg/ -iname "*.part" -exec rm {} \;

It removes .part files, which causes the "invalid or corrupted package" error. After you remove them, run this:

sudo pacman -Syyu

This should solve the problem, if there is no any missing key.

Guray Gurkan
  • 133
  • 2
  • 8
  • This worked for me on a Manjaro installation. I tried various fixes before this and the problem did not go away. This did the trick. – M Wade Jun 02 '20 at 22:01
1

I am using Manjaro and after a long search, I was able to fix the issue by following these simple commands.

NOTE: You must run pacman-key --init before first using pacman; the local keyring can then be populated with the keys of all official Manjaro Linux packagers with pacman-key --populate archlinux manjaro.

  • What URL did u get ur fix from? Also I'm too using Manjaro and ran into this snag but fortunately Google Search for my error msg (even tho it just 1st key failure) found 4-day old report & solution https://forum.manjaro.org/t/problem-to-update-jerome-leclanche-is-unknown-trust/50739/2 (alert: to get is fix, follow its immediate link then that's immediate link of ‘How to solve keyring issues in Manjaro‘) that worked flawless for me. It seems basically same fix as urs BUT gives background and {replaces ‘pacman-key --init’ with ‘sudo pacman -Syy && sudo pacman-key --refresh-keys’ --why?}. – Destiny Architect Jul 01 '18 at 05:44
0

failed to prepare transaction (invalid or corrupted database)

Here it was due to the actual (faulty) mirror servers delivering junk.

comment out those standard servers and use a quality server e.g.

ftp://ftp5.gwdg.de/pub/linux/archlinux/community/os/x86_64/

Too bad that /etc/pacman.conf is so poorly commented, as if to deliberatly be unhelpful and feckless, always being vague, never concretely helpful. this was the last error in an seemingly endless ordain of errors from pacman. keys are unmanagable, servers are a mess, libs spell chaos. Took me more than 1 day to get through this horrific Arch experience.

dotbit
  • 4,445
  • 1
  • 7
  • 8
0

The following is for ArchLinux however applies to other Linux distros too. To correct an invalid KEY one needs to do the following:

rm -fr /etc/pacman.d/gnupg
pacman-key --init
pacman-key --populate archlinux

say the key throwing an error is in Blackarch then is also needed to :

sudo pacman-key --populate blackarch

and finally

sudo pacman -Sy archlinux-keyring
sudo pacman-key --populate archlinux
sudo pacman-key --refresh-keys
Miguel Tomás
  • 1,714
  • 1
  • 13
  • 23