Home Arch Linux How To Fix Broken Pacman In Arch Linux

How To Fix Broken Pacman In Arch Linux

Fix "libalpm.so.15: No Such File or Directory" Error in Arch Linux Using pacman-static

By sk
1.7K views 3 mins read

This weekend didn’t end well for me. I accidentally deleted the libalpm library in my Arch Linux, and now neither Pacman, Paru, nor Yay are working. I can't run any package management operations with any of them. Whenever I try to perform a package operation, I get the following error message:

pacman: error while loading shared libraries: libalpm.so.15: cannot open shared object file: No such file or directory
libalpm.so.15 - No Such File or Directory
libalpm.so.15 - No Such File or Directory

Accidentally deleting critical libraries like libalpm can lead to a broken pacman or paru and yay on your Arch Linux system.

But don't worry - you don't need to reinstall Arch Linux. In this tutorial, we'll explain how to fix broken pacman in Arch Linux using pacman-static.

What is libalpm.so.15?

libalpm.so.15 is a shared library used by pacman, the package manager for Arch Linux. It stands for Arch Linux Package Management Library, and it's essential for pacman to function correctly. If this library is missing, pacman will fail to run, making it impossible to manage packages on your system.

The Problem: "libalpm.so.15: cannot open shared object file: No such file or directory"

When you encounter the error "libalpm.so.15: cannot open shared object file: No such file or directory", it means that pacman is unable to find the required shared library. This can happen if the library is accidentally deleted or if there's a corruption in the system.

The Solution: Fix "libalpm.so.15: cannot open shared object file: No such file or directory" Error using pacman-static

Precompiled binaries of pacman-static are available from AUR. These binaries are statically linked versions of pacman that don't depend on any shared libraries. Here’s how you can use them to resolve the issue:

Step 1: Download the Precompiled Binaries

First, you need to download the precompiled binaries from from this link.

curl -O https://pkgbuild.com/~morganamilo/pacman-static/x86_64/bin/pacman-static

Step 2: Make pacman-static Executable

Once downloaded, make the binary executable:

chmod +x pacman-static

Step 3: Use pacman-static to Fix Broken Pacman

Now, use pacman-static to reinstall pacman and its dependencies, including libalpm:

sudo ./pacman-static -S pacman

This command will reinstall pacman and fix the missing libalpm.so.15 issue.

Step 4: Verify the Installation

After reinstalling pacman, verify that pacman works correctly by running:

sudo pacman -Syu

If this command runs without errors, your system should be back to normal.

Step 5: Rebuild paru or yay

With pacman working again, you can proceed to rebuild paru:

sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/paru.git
cd yay/
makepkg -si

To rebuild yay:

sudo pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay.git
cd yay/
makepkg -si

Conclusion

Accidentally deleting critical libraries like libalpm can be a daunting experience, but you can easily fix the issue without a full system reinstall. Using precompiled binaries of pacman-static is a quick and effective solution to resolve the "libalpm.so.15: No such file or directory" error. By following the steps outlined in this guide, you can get your pacman, paru and yay back up and running smoothly.

Related Read:

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More