Clearing AUR Package Cache and old Config Files

It is relatively trivial to clean up the pacman cache (especially thanks to the utility shipped with the welcome app!), and @fbodymechanic provides some good advice on removing old config files: A Complete Idiot's Guide To Endeavour OS Maintenance / Update / Upgrade

However, I find that every so often my /home directory gets full of due to cached AUR packages (installed using yay) and old configuration files for packages I uninstalled. Often these include packages that I installed once to try out and then subsequently uninstalled. Including old config files, this can take up a sizeable amount of diskspace over a 6-12 month period. To date, I use dolphin to manually delete these files but does anyone know of a faster way?

1 Like

yay

-c, --clean remove old packages from cache directory (-cc for all)

1 Like

Thanks! Does that also deal with config files for uninstalled AUR packages?

Edit: I get an error message: “error: invalid option: ‘–clean’ and ‘–refresh’ may not be used together”

This should be the same as for any packages installed with pacman which keeps its config file/folders under the home directory.

You would need to look in there and delete them on a per case basis.

My bad :blush:

Try: yay -Sc

You will be asked

:: Do you want to remove all other packages from cache? [Y/n] n

and

Do you want to remove unused repositories? [Y/n] n

You could answer n if you want to keep them.

Then:

Build directory: /home/arch/.cache/yay
:: Do you want to remove all other AUR packages from cache? [Y/n] y
removing AUR packages from cache...
:: Do you want to remove ALL untracked AUR files? [Y/n] y
removing untracked AUR files from cache...

See: yay --help

3 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.