You are not logged in.

#1 2020-06-10 07:50:31

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,366

[SOLVED] Clearing ~/.cache

Is it safe to clear out the .cache folder in /home?

Mine currently occupies 24.4GB, that would be better used otherwise.

For info, I have done nothing special with my system to interfere with it.

Last edited by Roken (2020-06-11 05:45:27)


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#2 2020-06-10 08:41:03

kilix
Member
Registered: 2020-05-09
Posts: 23

Re: [SOLVED] Clearing ~/.cache

well, you can have e.g. mails stored in there.
You should probably check what's really inside, use for example du -h


Keep it simple, stupid.

Offline

#3 2020-06-10 10:09:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,791

Re: [SOLVED] Clearing ~/.cache

A cache is a cache - even if there're mails in there, they should™ only be cached versions of mails that are actually stored somewhere else (eg. some server)

But since a cache is a cache, deleting it stands a high chance of re-building it again - and fast.
Therefore it's indeed reasonable to check
a) what takes the most space
b) the timestamps on files (deleting cruft is good, but deleting stuff that's gonna be rebuild w/ the next login will probably only slow down the next login)

Likely offender are browser caches and image thumbnails.

Offline

#4 2020-06-10 10:14:18

philo
Member
Registered: 2015-01-26
Posts: 275

Re: [SOLVED] Clearing ~/.cache

This may help in answering your question:

https://www.reddit.com/r/archlinux/comm … ove_cache/

It also suggest to first just rename it and see if it hurts anything.

Last edited by philo (2020-06-10 10:17:15)

Offline

#5 2020-06-10 14:14:29

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,366

Re: [SOLVED] Clearing ~/.cache

Thank you.

@philo, I had, in fact, seen the Reddit post, but I'm more likely to trust here than Reddit.

Emails are stored on an NFS drive, so definitley no emails of any import in the cache.

I guess I'll go with the rename and see what happens. I'd be surprised to see 24.4GB rebuilt quickly.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

#6 2020-06-10 21:51:54

judd1
Member
Registered: 2015-09-04
Posts: 260

Re: [SOLVED] Clearing ~/.cache

sudo paccache -d

→ To verify your cache

sudo paccache -rk0 o -rk1 ...

→to completely remove your cache -rk0
→to leave a version of packages -rk1

Last edited by judd1 (2020-06-10 21:52:53)


This isn't right. This isn't even wrong.
-- Wolfgang Pauli --

Offline

#7 2020-06-10 22:06:04

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Clearing ~/.cache

judd1 wrote:
sudo paccache -d

→ To verify your cache

sudo paccache -rk0 o -rk1 ...

→to completely remove your cache -rk0
→to leave a version of packages -rk1

All of which has nothing to do with the contents of ~/.cache.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#8 2020-06-10 22:10:41

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [SOLVED] Clearing ~/.cache

If you have enough RAM, I recommend that you mount ~/.cache to tmpfs so it is cleared on a reboot (or you can symlink it to a tmpfs partition).  I do it that way, from /etc/fstab:

tmpfs /scratch  tmpfs size=29G,nodev,lazytime  0 0

Offline

#9 2020-06-10 23:35:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,518
Website

Re: [SOLVED] Clearing ~/.cache

Putting ~/.cache in RAM is pretty wasteful of both bandwidth and RAM and really defeats the purpose of cached data.  The whole point of ~/.cache is it is downloaded or generated content that will be needed next time a program is run.  Putting it in RAM just means all content needs to be regenerated again every time you reboot.

Last edited by Trilby (2020-06-10 23:35:36)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2020-06-11 05:45:09

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,366

Re: [SOLVED] Clearing ~/.cache

Well, no obviously ill effects after a few hours, and the regenerated .cache is only 1.1GB, so a saving of 23.3GB.

Thank you all. Going to mark as solved.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus B550-F Gaming MB, 128Gb Corsair DDR4, Fractal Design Define 7 XL, 5 HD (2 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

/ is the root of all problems.

Offline

Board footer

Powered by FluxBB