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: https://ostechnix.com/recommended-way-clean-package-cache-arch-linux/
Clean orphaned dependencies: sudo pacman -Rs $(pacman -Qtdq)
- https://man.archlinux.org/man/pacman.8.en
- 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, or pacman -Qdt
to list the packages that are dependencies of other packages. Use pacman -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 😃
Oh, that’s some amazing info, thanks!
I had noticed this might be a problem when I was setting something up and tried to install a dependency that was already on the system. It informed me it was being set to explicit and I wondered if it might lead to a situation like that.