Cleaning up packages?
I noticed while updating my system just how many packages I have installed that I don't recognize.
I tend to think that minimalism is better for security, so I'd like to remove any packages that I'm not using, but this is a bit of a scary task.
Does anybody have a safe method for reviewing and purging unused or bloat packages while obviously making sure not to accidentally remove important dependencies?
I'm on arch btw.
audaxdreik
in reply to brownmustardminion • • •EDIT: More information provided. I disagree with the upvoted comment implying you should leave your system alone because you might break something. You're using Arch, and part of the reason to use Arch is understanding how you built and maintain your system. Understanding how to inspect your system and perform proper maintenance is a crucial part of that. Read and think carefully before taking any actions and make sure any important information is backed up before taking major actions. Without throwing too much further shade, I find it disappointing so many in the community would take that stance and discourage you from pursuing this further.
When I switched to Arch, I started a notebook in Obsidian with a bunch of different information in it, I have a section devoted to Maintenance. Here are a few things I've put in there:
Clean package cache with paccache: ostechnix.com/recommended-way-ā¦
Clean orphaned dependencies:
sudo pacman -Rs $(pacman -Qtdq)
- man.archlinux.org/man/pacman.8ā¦
- Qtdg, Q (Query) t (unrequired) d (dependencies) g (groups)
- Rs, R (Remove) s (recursive)
Additionally, you can run
pacman -Qe
to list the packages you yourself have explicitly installed with pacman, orpacman -Qdt
to list the packages that are dependencies of other packages. Usepacman -Qm
to list packages not found in the official repositories (i.e., things installed through yay). This will allow you to review packages you may have explicitly installed in the past for some reason, but now find you no longer need.For yay, I'm unsure if I should be using
-Yc
,-Sc
, or-Scc
. If anyone has more info with that, I'd appreciate it.For flatpak:
flatpak uninstall --unused
And for journals:
journalctl --vacuum-time 7days
That's most of the "automatic" stuff, cruft that can be cleaned out with little to no consequence. Other than that, you'll just have to manually review what you have on your system.
If anyone has other commands or comments on the ones I provided, I'd be happy to accept further advice here as well š
The Recommended Way To Clean The Package Cache In Arch Linux
sk (OSTechNix)Eugenia
in reply to brownmustardminion • • •Termight
in reply to brownmustardminion • • •superkret
in reply to brownmustardminion • • •Just leave it. Either they do something in the background. Then you'll get issues when they're missing, and you'll never know which package is missing for what.
Or they don't do anything, then they just take up a few MB of disk space.
"Cleaning up" is the most sure-fire way to destroy your OS, and absolutely not worth anyone's time. Trust me, I've made that mistake multiple times.