My / (i.e. root directory) on my system is 25GB and I intend to keep
it only 70% full.
Here are some strategies to do that. Some of the strategies might be useful on other distributions too.
Keep your pacman/AUR helper cache outside of the root disk
# for pacman.conf
CacheDir = /mnt/different/disk/cache/paccache/pkg/
-
side note: use
paccacheto keep only a few old versions of packages, otherwise pacman -- and/or your AUR helper -- will keep many. -
side note2: you need to keep at least a single old version of the package because, in general, arch package mirrors only keep one version. You'll be SOL if the a new package version breaks your system and you don't have a copy of the previous version backed up locally
Keep your XDG directories outside of your home directory. Many (but not all) applications will honor your XDG_ env vars.
# set these in one of your bash config files
XDG_DATA_HOME=/mnt/different/disk/cache/xdg/local/share/sahal
XDG_CONFIG_HOME=/mnt/different/disk/cache/xdg/config/sahal
XDG_CACHE_HOME=/mnt/different/disk/cache/xdg/cache/sahal
XDG_STATE_HOME=/mnt/different/disk/cache/xdg/local/state/sahal
- If you use
docker(orpodman) keep your cache directory on a different disk
If you're not regularly using a non-english language on your system, you can remove unneeded locales.
Ensure that the following file contains the locales you do want to keep:
$ cat /etc/locale.nopurge|grep -v ^#|tr -s '\n'
MANDELETE
SHOWFREEDSPACE
VERBOSE
en
en_GB
en_GB.UTF-8
en_US
en_US.UTF-8
zh
zh_CN
zh_CN.Hans
zh_CN.Hant
zh_CN.UTF-8
zh_HK
zh_TW
de_DE
Clean up journal cache.
sudo journalctl --vacuum-time=30m
This will help you find large directories. Spend most of your time on the big directories.
Check to see if any files were kept even after removing a package. Not all the results here can or should be deleted. Use your judgement.
PACKAGENAME=flatpack
for file in $(pacman -Fl "${PACKAGENAME:-flatpak}" | \
awk '{print "/"$2}'); do
stat $file >/dev/null 2>&1 && echo $file exists
done
Use lostfiles to find files that are not owned by any package in
system. This has yet to be helpful, but it might be in the future