How to clean your Archlinux

Been using a while your computer, you may think about cleaning it from unused packages, pacman caches and dead files and symlinks specially when my PC runs out disk spaces.

Clean Pacman package’s cache:

Every time you install packages, your system cache the downloaded old package in a folder and doesn’t remove it after install.

First, let’s check the folder’s size by running this command:

du -sh /var/cache/pacman/pkg/ 

If the cache’s size is large then, we should clean it by running paccache -r

sudo pacman -Scc

In all kind of system, when you remove packages some of them required dependencies, so these dependencies will still installed but unused. If you want to check orphans packages,

sudo pacman -Qtdq
# If you want to delete them:
sudo pacman -Rns $(pacman -Qtdq)

Cleaning Home directory’s cache

As a full stack developer, I use many technologies on my projects, I put all my projects in a same folder to be sure, but cache and configs my go larger than you expect. To check the size of a specific folder you can run sudo du -sh ~/.cache/ or ~/.local/share/

If you want some extra tools to calculate space disk and easy use to clean, I recommend this awesome tool NCDU

Take care of your system 🐧❤️

You Might Also Like

Leave a Reply