There is no such a command.
There is pacman -Scc
and yay -Scc
. While the former will clear out all the packages from your
/var/cache/pacman/pkg ( these are packages installed from the repositories declared in pacman.conf) the latter, in addition, will clear all the packages and build files from AUR too, that you have used yay to build yourself. These are stored under ~/.cache/yay in your home directory.
It is not advisable to clear out all that packages from cache. There are rare cases when an update will break something on your system. Having those older packages in cache you can easily downgrade. But it is not the end of the world. You can still access those packages remotely from Arch’s archive.
There are also other tools like paccache
which will give you more options on what to clear out from your pacman cache.
Please refer to relevant sectors in ArchWiki regarding package management and system maintenance.
Read this too: How to run a stress-free EndeavourOS