The error is as the title says, here is an example of the yaourt
encountered before writing the article:
➜ ~ yaourt -Ss uswsusp
yaourt: error while loading shared libraries: libalpm.so.12
I looked at the system and found that libalpm.so
has been upgraded to 13
➜ ~ ls -l /usr/lib/libalpm.so*
lrwxrwxrwx 1 root root 13 Jul 16 03:26 /usr/lib/libalpm.so -> libalpm.so.13
lrwxrwxrwx 1 root root 17 Jul 16 03:26 /usr/lib/libalpm.so.13 -> libalpm.so.13.0.0
-rwxr-xr-x 1 root root 243608 Jul 16 03:26 /usr/lib/libalpm.so.13.0.0
Then, the problem is very simple, the library is upgraded, and the dependent software developers have not upgraded.
Next, only three steps are required:
libalpm.so
comes from, and download the old version (which may contain the 12
we need)/usr/lib
The search found that it may be in the pacman package
➜ ~ pacman -Ss libalpm
core/pacman 6.0.0-5 (base-devel) [installed]
A library-based package manager with dependency support
extra/pyalpm 0.10.6-1
Python 3 bindings for libalpm
(..... Other insignificant packages)
To download the old packages of Archlinux, you need to find it in the Arch archive.
In the /packages/p/pacman/
directory, I tried to download the previous version of the current version (v6.0.0), pacman-5.2.2-4-x86_64.pkg.tar.zst
.
Open directly and found libalpm.so.12
:
Finally, copy the decompressed libalpm.so.*
to /usr/lib
. (Be careful not to copy the libalpm.so
without the version suffix).