Search for apps, problems, ...

< Alle Themen

Cleanup arch Linux

From time to time, it is useful to clean a Linux distro as it will free quite some disk space. Here are some commands that may be useful if you use an arch distro such as Manjaro or Endeavour.

Clean pkg cache

Remove all downloaded pkg files and cleanup cache (uninstalled packages):

$ sudo pacman -Scc

Remove old package cache files except for the latest three package versions using paccache:

$ sudo paccache -rvk3

Remove unused packages

$ sudo pacman -Rcns $(pacman -Qtdq)

Clean journals

The following command will remove all entries, but will keep the most recent (1 week):

$ sudo journalctl --vacuum-size=500M && sudo journalctl --vacuum-time=7d

Clean Cache

The Cache is located in ~/.cache

The following command will delete all files that have not been accessed in 100 days:

$ find ~/.cache/ -type f -atime +100 -delete

Clean YAY cache and pamac build cache:

$ yay -Sc -a
$ pamac clean -bv

Clean temporary build files:

$ rm -rf ~/{.bundle,.cargo,.cmake,.dotnet,.electron,.electron-gyp,.gem,.gradle,.lazarus,.node-gyp,.npm,.nuget,.nvm,.racket,.rustup,.stack,.yarn} || true
$ rm -rf ~/.cache/{electron,electron-builder,go-build,node-gyp,pip,yarn} || true
$ sudo rm -rf ~/go || true
Contents