Oops, need 'squeegee', I hosed 'Pacman!'

After encountering the ‘Yay’ issue I ended up hosing pacman. Here’s the error I’m getting when attempting to run any pacman command:

pacman: error while loading shared libraries: libalpm.so.11: cannot open shared object file: No such file or directory
How do I re-install necessary files without doing a total system reinstall. Without pacman or yay I have no clue of how to replace the files that I hosed. It looks as though the main file of libalpm.so.* is missing and I do not know how to reinstall it. I think the file libalpm.* is part of the ‘pacutils’, but I am not certain. Help! Thank you.

You have to do some command line magic :slight_smile:

Here is how to fix pacman:

  1. grab the last pacman from archlinux.orghttps://www.archlinux.org/packages/core/x86_64/pacman/ ; download it “from mirrors”.
  2. Go to your download directory. Open a terminal in it.
  3. sudo cp pacman-5.2.0-2-x86_64.pkg.tar.xz /
  4. cd /
  5. tar xvfJ pacman-5.2.0-2-x86_64.pkg.tar.xz
  6. sudo rm -f pacman-5.2.0-2-x86_64.pkg.tar.xz → be careful with that line
  7. exit terminal

Now pacman should be working again. Just remove and reinstall yay after untarring pacman. I won’t promise you 100% success, but it can work. Well, it did for me once, 2 or 3 years ago :smile:

Source of this trick? https://wiki.archlinux.org/index.php/Pacman#Manually_reinstalling_pacman

By the way, liblapm is part of pacman.

fred@fredo-arch-mate ~ % pacman -Ql pacman | grep libalpm.so 
pacman /usr/lib/libalpm.so
pacman /usr/lib/libalpm.so.12
pacman /usr/lib/libalpm.so.12.0.0