436
submitted 9 months ago* (last edited 9 months ago) by Zangoose@lemmy.world to c/linux@lemmy.ml

Alt TextA 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

top 50 comments
sorted by: hot top controversial new old
[-] bizdelnick@lemmy.ml 164 points 9 months ago* (last edited 9 months ago)

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.

[-] redd@discuss.tchncs.de 25 points 9 months ago

So OP's headline should be saying instead: Reminder to CHECK your ~/.cache folder every now and then

[-] cupcakezealot 21 points 9 months ago

just symlink ~/.cache to /dev/null

load more comments (2 replies)
load more comments (5 replies)
[-] nick@midwest.social 84 points 9 months ago

That’s not very cache money of you

[-] ryannathans@aussie.zone 80 points 9 months ago

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

[-] sebsch@discuss.tchncs.de 50 points 9 months ago

So the apps are broken. Cache is meant to be deleted at any time

load more comments (2 replies)
[-] MangoPenguin 29 points 9 months ago

For some reason devs can't wrap their head around cache being temporary.

[-] Iapar@feddit.de 25 points 9 months ago

You shouldn't have done that Dave.

load more comments (3 replies)
[-] sebsch@discuss.tchncs.de 41 points 9 months ago

Even better: mount ~/.cache as ramfs. It will also speed up some apps significantly.

[-] redd@discuss.tchncs.de 11 points 9 months ago

I always felt that there should be some user directory like /tmp/ which will be wiped regularly.

[-] glibg10b@lemmy.ml 9 points 9 months ago

/run/ contains such a directory

[-] neonred@lemmy.world 40 points 9 months ago* (last edited 9 months ago)

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.

[-] danielquinn@lemmy.ca 11 points 9 months ago

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?

[-] Secret300@sh.itjust.works 8 points 9 months ago

Once I get more than 16GB of ram I'll definitely try that

[-] glibg10b@lemmy.ml 7 points 9 months ago

This seems like a filename conflict waiting to happen. Why not just mount a tmpfs there?

load more comments (4 replies)
load more comments (1 replies)
[-] SuperIce@lemmy.world 36 points 9 months ago

I don't think I've ever seen .cache get bigger than 10GB

[-] Zangoose@lemmy.world 29 points 9 months ago

It looks like yay was storing AUR build files there, that folder took up about 160 of the 164GiB

[-] SuperIce@lemmy.world 21 points 9 months ago

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).

load more comments (1 replies)
load more comments (10 replies)
load more comments (4 replies)
[-] Pantherina@feddit.de 22 points 9 months ago

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.

load more comments (1 replies)
[-] dog_@lemmy.world 18 points 9 months ago

Question, could you have cron/crontab do it monthly or something? Do it monthly meaning delete everything in ~/.cache every month or so?

[-] skullgiver@popplesburger.hilciferous.nl 42 points 9 months ago* (last edited 9 months ago)

[This comment has been deleted by an automated system]

load more comments (1 replies)
load more comments (12 replies)
[-] majestic@sh.itjust.works 17 points 9 months ago

No way. If i clean up my .cache directory my precious cached with sccache rust deps would be very upset. >:[

[-] noroute@lemmy.world 14 points 9 months ago

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.

load more comments (1 replies)
[-] conorab@lemmy.conorab.com 13 points 9 months ago

Doesn’t Steam store the game library there?

[-] CheesyFox@lemmy.world 11 points 9 months ago
load more comments (1 replies)
[-] Zangoose@lemmy.world 11 points 9 months ago

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

load more comments (1 replies)
[-] vox@sopuli.xyz 9 points 9 months ago* (last edited 9 months ago)

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

[-] just_another_person@lemmy.world 7 points 9 months ago

This particular folder caches many things from various package managers. Won't hurt to clear, but will fill up again. Maybe consider not using caches when engaging such things.

load more comments (7 replies)
[-] Jinn@sh.itjust.works 7 points 9 months ago

This is one of those things that makes me shake my head about Linux. It's these small dumb problems that make Linux inaccessible to the common person.

[-] NegativeLookBehind@kbin.social 35 points 9 months ago

Yes because other operating systems never have any small annoying issues.

load more comments (8 replies)
[-] SuperIce@lemmy.world 13 points 9 months ago

Not really. I've never seen .cache get bigger than 10GB, which is about how big the temporary files in Windows get if you never clean them.

load more comments (1 replies)
[-] UndercoverUlrikHD@programming.dev 11 points 9 months ago

I've seen similar issues in appdata on windows when a program is poorly configured and simply grow its logs to ridiculous sizes. It's an issue with a program utilising that folder, not the os.

load more comments (9 replies)
load more comments
view more: next ›
this post was submitted on 03 Dec 2023
436 points (100.0% liked)

Linux

47450 readers
1736 users here now

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

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS