Alt Text
A screenshot of a file manager preview window for my ~/.cache folder, which takes up 164.3 GiB and has 246,049 files and 15,126 folders. The folder was first created about 1.75 years ago with my system
You don’t have to clean your ~/.cache every now and then. You have to figure out which program eats so much space there, ensure that it is not misconfigured and file a bugreport.
So OP’s headline should be saying instead:
Reminder to CHECK your ~/.cache folder every now and then
just symlink ~/.cache to /dev/null
Cache exists for a reason, that sounds like itd break programs, a safer method is probably having it be a ramdisk
I don’t think I’ve ever seen .cache get bigger than 10GB
It looks like yay was storing AUR build files there, that folder took up about 160 of the 164GiB
You can use
yay -Sc
to clean the cache. It’ll also ask you if you want to clean the pacman cache, which I’m assuming you also haven’t cleaned (check the size of/var/cache/pacman
).One would just need to modify the pacman cache hook for yay. I’m too lazy tho.
You should try using paru, might be better off with it.
it doesn’t matter if you use paru, yay or heck makepkg if you are compiling packages with hilariously large sources like for example webbrowser (librewolf, brave, ungoogled-chromium, firedragon take each like ~30 GB) without pruning the build cache afterwards
Your Distro should normally do that for you.
Advising for this means people will delete random cache and download stuff always.
Are multiple files in there? If yes you could add a script that only deletes files of certain age.
I’m not aware of any distro that automatically clears a user’s .cache in their home directories. Maybe you’re thinking of /var/cache?
I did this and now my games have no icons in lutris, some of my gnome settings got reset and my proton email bridge stopped working
So the apps are broken. Cache is meant to be deleted at any time
not necessarily during runtime
But a restart of an app should fix it.
You shouldn’t have done that Dave.
Is it safe to clear
~/.cache/mozilla/
while Firefox is running?No.