What happens if you remove the Arch Linux package manager, and what are the risks you are taking once you do so? Is there a way to reinstall pacman? Are you able to remove it from other Arch-like distributions that use the same package manager? Are you risking breaking your Linux System by uninstalling it?
Arch Linux runs fine without Pacman
I decided to try uninstalling pacman myself by installing Arch Linux in a virtual machine and removing it by itself. It is important to only remove that package though by running:
- Normal User:
sudo pacman -Rd --nodeps pacman
- As root:
pacman -Rd --nodeps pacman
Running sudo pacman -R pacman
fails as there are dependencies that depend on Pacman.
ATTEMPTING TO REMOVE sudo pacman -Rs pacman
, or sudo pacman -Rsc pacman
WILL REMOVE ALL PACKAGES THROUGH DEPENDENCIES, AND YOU WILL BE LEFT WITH A BROKEN SYSTEM!
Pacman warns that is designated at a HoldPkg for safety reasons. Making sure that the package manager was the only package I was removing, I consented to the removal. I had no other issues removing the package from the system.
As a consequence of deleting an important package, some breakage occurred. Attempting to use an AUR helper to install packages failed. Some libraries even show up as missing because they were deleted. To put it in simple terms, this is Arch without a package manager.
I highly recommend against uninstalling Arch’s Package Manager. Arch Linux is a rolling-release Linux Distribution, therefore you are at risk of falling behind on updates. Installing update every package yourself takes a tedious amount of time and skill.
Linux can easily break trying to update every package manually. Differentiating versions of system packages can prevent you from using the appropriate utilities to make the packages. In fact, some certain system programs may stop running altogether. This results in a broken system. For these reasons, consider reinstalling pacman.
Reinstalling Pacman: Do It Right…
Trying to reinstall Arch’s package manager absolutely takes some know-how. I was able to corrupt my system by attempting to move pacman back to the correct directories. A foolish oversight moved all of my files to weird locations I couldn’t understand.
Without a GUI, I typed the wrong commands into the terminal. Nevertheless, I redownloaded pacman manually to fix my system.
Reinstalling pacman this way is not recommended though. The system could end in a worse state and you could lose important files. This could mean reinstalling the system from scratch!
Please read the following forum posts and wikis. The latter also provides two specific methods to reinstalling pacman. Read all of the instructions carefully before attempting to restore the package manager.
The links are available below:
- Pacman Command Not Found – Arch Linux Forum
- Pacman Commands Not Working From Command Line – Arch Linux Forum
- Pacman Crashes During An Update – Arch Linux Wiki
- Manually Reinstalling Pacman – Arch Linux Wiki
Do Not Attempt This On Manjaro
Like Arch Linux, Manjaro will simply not allow you to simply uninstall pacman as you would think.
Attempting to run sudo pacman -R pacman
will fail with error: failed to prepare transaction (could not satisfy dependencies)
, listing a few important packages that YOU SHOULD NOT REMOVE, such as manjaro-system, mhwd, and even yay if you use AUR packages.
Attempting to run sudo pacman -Rs pacman
will yield the same result, requiring the use of sudo pacman -Rd --nodeps pacman
to continue uninstalling this package without affecting the other ones.
Once again, Manjaro will specify that this package is being held, requiring confirmation to remove it. When do you remove it, it will probably behave the same way Arch Linux behaved with no package manager and missing libraries. You will also have problems with Octopi and Pamac, seeing as they no longer have a backend to work with.
To reinstall Manjaro’s Package Manager without a Live CD, you must download it from one of the Manjaro Repos, as downloading the one Arch uses could cause issues with other packages, being released on an entirely different release schedule, causing version dependency issues.
To get a list of repos to download the correct file from, go to the Manjaro Repo List Website. Select the mirror closest to you, then click the branch that you are using (Usually Stable or x32-stable if you are using a 32-bit Operating System), core, amd64 (Normal) or i386 (x32), then scroll down to find the appropriate pacman package you need.
Use the Find Tool to find it faster. CTRL+F or CMD+F are the usual shortcuts. Once you download this package, follow the steps mentioned above. Installation is similar to a package install.
Conclusion – Should You Remove Pacman?
Have a machine you wouldn’t mind breaking? Feel free to try this experiment yourself. Consider using a Virtual Machine instead so that you don’t affect your original files.
Learning to reinstall Pacman by yourself makes a great opportunity to learn more about what Arch Linux is and how it works. You could also learn how to get around Linux without a package manager, which can be quite difficult but would also teach you a lot of information about the system.
I would NOT recommend this experiment to people who are new to using Linux. Seeing as mistyping one command can destroy your entire system, it is a good idea to learn more about how Linux works before even trying this. This experiment is for people who are advanced users. Other package managers, such as the Advanced Packaging Tool, put in heavier safeguards for removing themselves for good reasons.
Feel free to come back once you know more about the inner workings.
Please let us know in the comments whether you want to see what happens when you try this on other distributions such as Debian and Ubuntu, and feel free to request your own experiment down there as well. If you liked the post, please give us a favorite, and stay tuned for more Linux experiments in the future. Also feel free to take a look at some of the other content we produce, such as the three hardest distributions. Thanks for reading this blog post, and have a splendid day!
Leave a Reply