System clean up & Maintenance

Indeed these commands should not be used for regular maintenance:

Delete Pacman Cache

  • pacman/yay -Sc/c

Remove Orphan packages

  • sudo pacman -Rns $(pacman -Qtdq)

Clean the Cache

  • rm -rf .cache/*

Pacman package cache should never be removed completely, you should always keep at least one or 2 in the cache to be able to roll back in an emergency.
And using orphan package removal can indeed cause harm to your system if you do not take care of what exactly it will remove.

And in ~/.cache you have also stuff you may need like for AUR builds from yay (or other AUR helpers)

For package cache, there is paccache that can be used by removing old packages and keep the needed last versions.
There is also an eos-tool in welcome to set this up.

7 Likes