Pacman, yay, and libalpm.so.15

About a week ago I went to use yay to upgrade after having run sudo pacman -Syu. I was met with error while loading shared libraries: libalpm.so.15: cannot open shared object file: No such file or directory which was annoying. A quick search showed me that /usr/lib contained libalpm.so.14 so I created a symbolic link. I think I messed something up at that point. However, I got yay to run again so was pleased and decided to remove the symbolic link under the impression it shouldn’t be needed next time (assuming 15 would be available). Unfortunately I managed to delete libalpm.so altogether.

I didn’t realise this until today when I went to use pacman and it was borked with the same error. ls -l /usr/lib/libalpm.so* showed me a symbolic link /usr/lib/libalpm.so -> libalpm.so.15 (pretty sure I messed up the linking as well as deleting the wrong stuff).

After 30 minutes of trying to figure out what I should do and seeing lots of stuff about chrooting1 from a live USB (and cursing myself for not having a good backup in place2), I went and had some tea.

On return, I found the wonder that is a binary of pacman-static, popped it in home/bin ran chmod +x ./pacman-static on it and ran it with sudo ./pacman-static -Syu. This updated my system and somehow still failed to fix pacman.

Once I decided to turn my brain back on, I realised that I could run sudo ./pacman-static -Syu pacman. Voila, everything works again.

Confirmed with ls -l /usr/lib/libalpm.so* which outputs:

lrwxrwxrwx 1 root root     13 Sep  9 09:50 /usr/lib/libalpm.so -> libalpm.so.15
lrwxrwxrwx 1 root root     17 Sep  9 09:50 /usr/lib/libalpm.so.15 -> libalpm.so.15.0.0
-rwxr-xr-x 1 root root 260072 Sep  9 09:50 /usr/lib/libalpm.so.15.0.0
  1. I want to truly understand what chrooting is and how it works and not feel like I’m randomly chanting arcane spells into the outer void whilst blindfolded. ↩︎
  2. What is a good backup strategy for Arch? ↩︎

Leave a comment