Arch Linux: package-query: error while loading shared libraries: libalpm.so.11
Tags: archlinux, troubleshooting
Published: 2019-10-26 14:13:35

---
title: Arch Linux: package-query: error while loading shared libraries: libalpm.so.11
published: true
date: 2019-10-26 14:03:43 UTC
tags: archlinux,troubleshooting
canonical_url: https://rtfm.co.ua/en/arch-linux-package-query-error-while-loading-shared-libraries-libalpm-so-11-2/
---

![](https://rtfm.co.ua/wp-content/uploads/2018/04/archlinux_logo.png)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`](https://wiki.archlinux.org/index.php/Pacman#Removing_packages)) 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

- <small>03/13/2017</small> [Arch: yaourt – ERROR: One or more PGP signatures could not be verified](https://rtfm.co.ua/arch-yaourt-error-one-or-more-pgp-signatures-could-not-be-verified/)  
- <small>10/05/2017</small> [Arch Linux: error: failed to commit transaction (conflicting files)](https://rtfm.co.ua/arch-linux-error-failed-to-commit-transaction-conflicting-files/) 
- <small>12/14/2018</small> [Arch Linux: File /usr/lib/libQt5Positioning.so.5.12.0 is empty, not checked](https://rtfm.co.ua/arch-linux-file-usr-lib-libqt5positioning-so-5-12-0-is-empty-not-checked/)
- <small>05/06/2017</small> [Arch: skype error while loading shared libraries: libssl.so.1.0.0 – три решения](https://rtfm.co.ua/arch-skype-error-while-loading-shared-libraries-libssl-so-1-0-0-tri-resheniya/)