Here is a short article to remind myself how to clear up the home partition in Arch Linux.
When using your install for a while you might notice your disk usage nearly maxed out:
[me@hml ~]$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ArchinstallVg-root 50G 43G 7.7G 85% /
Under sync options you will see this on the pacman man page:
SYNC OPTIONS (APPLY TO -S) -c, –clean Remove packages that are no longer installed from the cache as well as currently unused sync databases to free up disk space. When pacman downloads packages, it saves them in a cache directory. In addition, databases are saved for every sync DB you download from and are not deleted even if they are removed from the configuration file pacman.conf(5). Use one –clean switch to only remove packages that are no longer installed; use two to remove all files from the cache. In both cases, you will have a yes or no option to remove packages and/or unused downloaded databases. If you use a network shared cache, see the CleanMethod option in pacman.conf(5).
So, to clear the cache simply use:
sudo pacman -Sc
More specifically, the Arch wiki has a second, stronger option listed.
To remove all the cached packages that are not currently installed, and the unused sync databases, execute:
# pacman -Sc
To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache directory:
# pacman -Scc
So if you don’t mind having everything wiped this option might be good too.
sudo pacman -Scc
https://wiki.archlinux.org/title/Pacman#Cleaning_the_package_cache