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.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
So OP's headline should be saying instead: Reminder to CHECK your ~/.cache folder every now and then
That’s not very cache money of you
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
For some reason devs can't wrap their head around cache being temporary.
You shouldn't have done that Dave.
Even better: mount ~/.cache as ramfs. It will also speed up some apps significantly.
I always felt that there should be some user directory like /tmp/
which will be wiped regularly.
/run/ contains such a directory
Because of excessive RAM I symlink ~/.cache
to /tmp
. Additionally installing zramswap
helps for this scenario.
Benefits are faster access, automatc purging between reboots and no wear to the NMVe drive.
Yes, this is a single user scenario.
Isn't most of what's in there just filters downloaded from the internet? Python packages, browser cache, etc? Your system confirms you to redownloading everything all the time, no?
This seems like a filename conflict waiting to happen. Why not just mount a tmpfs there?
Once I get more than 16GB of ram I'll definitely try that
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
).
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.
Question, could you have cron/crontab do it monthly or something? Do it monthly meaning delete everything in ~/.cache every month or so?
No way. If i clean up my .cache directory my precious cached with sccache rust deps would be very upset. >:[
Doesn’t Steam store the game library there?
No, .cache is similar to a temporary directory (or at least in theory) where important data isn't supposed to be stored there, instead only temporary files that might speed things up (e.g. images in a browser or thumbnails in a file manager). In this case it looks like all of my AUR packages had their source files cached, which added up over the ~1.75 years that I've been running this distro
You can also setup a cron job to periodically clean oldest files for you.
Example: @weekly find ~/.cache -type f -mtime +7 -delete
This will delete everything older than 7 days inside your cache folder.
seems like a bug in one of rhe programs you're using.
modt software automatically manages it's cache...
are you using build caching tools such as Mozilla sccache? These tend to create 20gb+ cache directories, especially if used with debug builds
....yeah let me go check that...
13,574 totaling 1.7gb, not too bad. Hey OP how do you get to this view? It looks like we both use nautilus but when I select "properties" on the .cache folder it looks different.
NEVER