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
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.
Table of Contents
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:
- How To Restore Broken Arch Linux To Previous Working State
- How To Fix “unable to lock database” Error In Arch Linux
- How To Fix “invalid or corrupted package (PGP signature)” Error In Arch Linux
- How To Solve “Starting full system upgrade… there is nothing to do” Issue In Arch Linux
- How To Solve “error: failed to commit transaction (conflicting files)” In Arch Linux
- How To Fix Broken Ubuntu OS Without Reinstalling It