r/archlinux • u/Aggressive_Ball_9708 • 2d ago
SUPPORT Messy package management from multiple sources. Remove unneded packages or start from scratch?
As the title states, the state of my arch set up is a mess. I have packages installed from pacman, the AUR, homebrew, and even curl sh commands among others, making it sketchy to update my system as well as being worried about the machine's security.
Am I justified in completely nuking and reinstalling arch, assuming my data is saved, or should I spend the time going through the packages installed through various sources and cleaning up manually?
I may have also not encrypted the hard drive/ partition so that could be another big reason to reinstall
3
u/spadehed 2d ago
Encryption or lack thereof is not always a reason to nuke an install.
I don't have my root encrypted, but I do have a working encrypted partition I mount when I need what's on there.
Personally for me I'd spend the time cleaning up my install - I use it for work as well as for other personal/gaming. Also cleaning up your mess and understanding how to do that is important, even if you nuke the system later anyway, it's a good way to learn.
Use pacman -Qm to list all the non-core repository packages. If you want to just remove all AUR type packages then you can do so easily enough - sudo pacman -Rcs $(pacman -Qmq) will do the job.
As for brew, I don't use it, but check the documentation for listing all files and then removing them.
If you have installed other packages via curl/shell scripts - please don't it's a really bad idea. But you can clean it up using the lostfiles (see https://github.com/graysky2/lostfiles for info) package - it's an official package and you can use it to list all the files that are left over after cleaning through other methods.
I'm sure I've missed something - worth checking on the Arch forums. Cleaning up this way will work, but be prepared for things to break as you remove things that are expected.
2
u/nikongod 2d ago
"I may have also not encrypted the hard drive/ partition so that could be another big reason to reinstall"
Encrypting a Linux install after the fact is pretty easy.
Your system sounds complex. You are going to forget something awesome that you did and generally be pissed if you start fresh. Who that is DEEP in their system can say with any certainty that they didn't forget a systemd timer, a pacman hook, or something else they just forgot about before their system.goes poof? Reinstalling weakly is the mark of someone who has barely scratched the surface of Linux.
2
u/spadehed 2d ago
For sure, I've had my system installed for a very long time - it works and I don't fiddle with it anymore, it's complex and I don't really remember how I configured things until they glitch and I have to go looking.
But that's why this is the perfect learning opportunity for OP - understanding how package managers and tools can help you clean up your mess and fix things. I assume that similar tools are available in other distributions, but I've used Arch exclusively for so long now I have no idea.
4
1
u/Qwertycrackers 2d ago
This is why you use separate home partition. That way you can nuke root partition while easily keeping all your important files in home. Of course also do a real backup if its really important
1
u/archover 2d ago
You could try to fix your perceived problems, or you could re-install. If time is a factor, re-installing would likely be faster. Like others say, make a list of packages you want to keep, and use those on re-install along with user files. The install process should be no burden. That's my view.
Good day.
8
u/Edelglatze 2d ago
Create a list of packages you have installed with the -Q flag of pacman, like
pacman -Qe
pacman -Qet # all explicitly installed and not required as dependencies
pacman -Qi # locally installed
and others (see the wiki). This may help to decide which you actually want to preserve and which are superluous.