DEV Community

Arseny Zinchenko
Arseny Zinchenko

Posted on • Originally published at rtfm.co.ua on

Arch Linux: package-query: error while loading shared libraries: libalpm.so.11

Didn’t install upgrades for a couple of weeks, today packages to be upgraded became over 100, so I run it.

Upgrades on my Arch Linux are installed with a simple alias in the.bashrc:

...
alias osupgrade="yaourt -Syua --noconfirm"
...

The error

Usually, it works greats (under the hood yaourt anyway will use pacman for packages from the official repository) and almost two years was no issues, but today an upgrade process stopped with errors:

...
(20/21) Updating the desktop file MIME type cache...
(21/21) Updating the MIME type database...

package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
==> ERROR: unable to update

package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
==> ERROR: unable to update

package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
==> ERROR: unable to update

package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
==> ERROR: unable to update

package-query: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory

No database errors have been found!

Check the package-query package dependencies:

$ ldd /usr/bin/package-query
...
libalpm.so.11 => not found
...

Check if files are present on the system:

$ ls -l /usr/lib/libalpm.so*
lrwxrwxrwx 1 root root     17 Oct 22 05:06 /usr/lib/libalpm.so -> libalpm.so.12.0.0
lrwxrwxrwx 1 root root     17 Oct 22 05:06 /usr/lib/libalpm.so.12 -> libalpm.so.12.0.0
-rwxr-xr-x 1 root root 223616 Oct 22 05:06 /usr/lib/libalpm.so.12.0.0

But its version is libalpm.so. 12.0.0 while package-query is looking for 11.

Solution #1 (wrong) – symlink

The very first idea is just to place a symlink to the new version during the upgrade process.

But that’s a terrible idea, especially for libraries.

Still – you can do it:

$ sudo ln -s /usr/lib/libalpm.so.12 /usr/lib/libalpm.so.11

Solution #2 (correct) – re-build a package with makepkg

So, we need to re-install package-query to update its dependencies links, remove it:

$ sudo pacman -R package-query
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)

:: removing package-query breaks dependency 'package-query>=1.8' required by yaourt

Add dd options (see pacman) to ignore dependencies here:

sudo pacman -Rdd package-query

Packages (1) package-query-1.9-3

Total Removed Size:  0.09 MiB

:: Do you want to remove these packages? [Y/n] y
...

Download the package-query package from its Github repository:

$ git clone https://aur.archlinux.org/package-query.git
$ cd package-query/

Build and install with the makepkg (-i, --install):

$ makepkg -si
...

==> Installing package package-query with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) package-query-1.10-1

Total Installed Size:  0.07 MiB

:: Proceed with installation? [Y/n] y

...

Check again with the ldd:

$ ldd /usr/bin/package-query | grep libalpm.so
libalpm.so.12 => /usr/lib/libalpm.so.12 (0x00007fb7b6cab000)

Re-run the upgrade:

...
(1/3) Arming ConditionNeedsUpdate...
(2/3) Updating icon theme caches...
(3/3) Updating the desktop file MIME type cache...
No database errors have been found!

Done.

Similar posts

Top comments (2)

Collapse
 
just1602 profile image
Justin Lavoie

yaourt isn't maintain anymore. Do you plan to migrate to something else?

Collapse
 
setevoy profile image
Arseny Zinchenko

Yeah, I have yay just didn't use yet (yaourt was a bit simpler in daily use as for me).
But since the latest issue - yeah, also updated my alias and replaced yaourt with yay.