Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot upgrade Archlinux (pacman -Syu not working)

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 <[email protected]>" 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.
like image 488
Cristian Avatar asked Feb 07 '16 08:02

Cristian


People also ask

How do you clear pacman cache Arch Linux?

Pacman has a built-in option to remove all cached packages. You can clean the cached packages by running sudo pacman -Sc command. However, this command will remove all cached old versions and leave only the versions of packages which are currently installed available.


5 Answers

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.

like image 50
rodrigo Avatar answered Sep 29 '22 16:09

rodrigo


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
like image 27
Denis Chevalier Avatar answered Sep 29 '22 16:09

Denis Chevalier


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 ..
like image 31
hak8or Avatar answered Sep 29 '22 14:09

hak8or


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.

like image 44
Guray Gurkan Avatar answered Sep 29 '22 16:09

Guray Gurkan


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.

like image 24
Ajay Mishra Avatar answered Sep 29 '22 15:09

Ajay Mishra