bizdelnick, (edited )

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,
@redd@discuss.tchncs.de avatar

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

bizdelnick,

Check? Why?


<span style="color:#323232;">% du -sh ~/.cache
</span><span style="color:#323232;">1,6G    /home/bizdelnick/.cache
</span>

I don’t remember if I ever cleaned it up. Probably a couple years ago when I moved my old HDD to new PC with freshly installed OS. It does not grow accidentally. Only in some very rare cases. As well as some other dirs under ~ and var. If it is a critical system, set up monitoring of free filesystem space. If not, you will notice if it becomes full (I can’t remember when this happened to me last time, maybe ~15 years ago when some log file started to grow because of endless error messages).

redd,
@redd@discuss.tchncs.de avatar

Because some users experienced accidential grows like OP had 160 Gbyte. So general advice for linux users can be stated as: Check your ~/.cache every now and then

Critical systems/servers shall better be monitored as you suggest.

bizdelnick,

Some users experienced accidential growth of /var/log. Some users experienced accidential growth of /var/cache. Some users experienced accidential growth of /var/lib. Some users experienced accidential growth of ~/.xsession-errors. Shall I continue?

Does every user need to begin his day checking all that places? No, he does not. It is waste of time. Such situations are extremely rare. If you are paranoid, check df to see if you have enough free space, and only if it unpredictably shrinked begin to ivestigate which directory has grown.

redd,
@redd@discuss.tchncs.de avatar

I don’t get your point. Why should somebody do this every day?

As the experience from other users in this thread, it seems not extremely rare to have an overgrown ~/.cache/ folder. So checking it from time to time is a good advice. If we all do this for a time, and create bug tickets for software which is not cleaning up. Then this problem will hopefully go away with future software releases.

bizdelnick,

Why should somebody do this every day?

Why should somebody do this ever?

As the experience from other users in this thread, it seems not extremely rare to have an overgrown ~/.cache/ folder.

It is the first thread about overgrown ~/.cache directory I see since I use Linux (~16 years or so). But, as I wrote above, this sometimes (rarely) happens with log files and some other directories. Checking each of them is a waste of time, if not automated, checking just one or few of them makes sense only if you are testing some app and looking for files it creates.

cupcakezealot,
@cupcakezealot@lemmy.blahaj.zone avatar

just symlink ~/.cache to /dev/null

KSPAtlas,
@KSPAtlas@sopuli.xyz avatar

Cache exists for a reason, that sounds like itd break programs, a safer method is probably having it be a ramdisk

qaz,
Amends1782,

Lmao some malicious ass advise here

sunred,
@sunred@discuss.tchncs.de avatar

du -sh ~/.cache/* | sort -h

Atemu,
@Atemu@lemmy.ml avatar

<span style="color:#323232;">ncdu ~/.cache/
</span>
therealjcdenton,
noroute,

deleted_by_author

  • Loading...
  • twei,

    I guess you could also Mount a tmpfs to that directory

    lntl,

    $ crontab -e

        • */2 * rm -rf /home/lntl/.cache
    vox,
    @vox@sopuli.xyz avatar

    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

    HiddenLayer5,

    I just map both the user cache and the /tmp directory to a RAM drive. I allocated 4 GB but in practice it never gets even close to that much, and Linux seems to not be reserving the entire 4 GB at boot so I would assume how much RAM is used depends on how much is actually in your cache.

    It also defers cache and tempfile related problems to turning it off and on again.

    Pantherina,

    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.

    Takios,

    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?

    redd,
    @redd@discuss.tchncs.de avatar

    Is it safe to clear ~/.cache/mozilla/ while Firefox is running?

    Pantherina,

    No.

    Zangoose,

    Maybe not while it’s running, but .cache is intended to be temporary files only so expecting files to permanently be there should be treated as a bug

    ArcaneSlime,

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

    kaesaecracker,

    the screenshot does not look like nautilus, maybe xfce?

    Zangoose,

    I use thunar (with ePapirus-Dark icons which is probably what makes it look like nautilus), I liked nautilus when I used it but thunar has a bit more functionality that I like

    ArcaneSlime,

    Ah thanks!

    Shape4985,
    @Shape4985@lemmy.ml avatar

    Bleachbit is good for clearing up some space

    OsrsNeedsF2P,

    And deleting emails

    zingo,

    Even Hillery knows that one.

    Come on!

    /s

    possiblylinux127,

    Check which folder is the biggest. I am going to go on a lim and say it probably is being caused by file roller

    Zangoose,

    It’s yay, which took up ~160 GiB. It was storing previous versions of AUR binaries which I guess added up over time. I posted a screenshot of ncdu outputs for a more detailed breakdown in one of the other reply threads

    archy,
    
    <span style="color:#323232;">yay -Sc(c)
    </span>
    

    Is probably a better command in this instance

    sunred,
    @sunred@discuss.tchncs.de avatar

    Honestly the reason I’ve put yay/paru’s build directory into ram/tmpfs long ago. It’s almost never worth it keeping all those packages checked out. You also do your ssd a favour by not hammering it with compile workloads.

    Lionel,

    This is why Linux sucks!

    xor,

    That’s nice

    archy,

    Like the kernel itself sucks or a specific distro sucks?

    TheWoozy,

    Don’t feed the trolls.

    Lionel,

    ALL OF IT

    zingo,

    Shotgun approach I see.

    PixxlMan,

    Windows famously never generates any garbage files. It’s so reliable all servers run windows. Right?

    sebsch,

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

    redd,
    @redd@discuss.tchncs.de avatar

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

    glibg10b,

    /run/ contains such a directory

    Krause, (edited )
    @Krause@lemmygrad.ml avatar

    /tmp and /var/tmp are writable to regular users on most distributions

    majestic,

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

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines