3

My .cache folder is occupying over 6GB of space. It is safe to delete it? The contents of my .cache are:

bazel dconf fontconfig jedi matplotlib motd.legal-displayed pip

  • 3
    Safe. Most applications only store there data that should be trivial. In some cases it's even desirable to remove data in such directories, for example pip – Sergiy Kolodyazhnyy Feb 25 '19 at 10:26
  • You could consider keeping the ~/.cache/dconf though – Sergiy Kolodyazhnyy Feb 25 '19 at 10:29
  • 1
    sure, but it won't stop it from comming back. It might be better to check each of the application responsible and check for a setting. – Rinzwind Feb 25 '19 at 10:39
  • @SergiyKolodyazhnyy any particular reason for retaining the dconf folder? Sorry, I am not very familiar with all this. –  Feb 25 '19 at 12:05
  • 2
    @user110327 dconf is database of user settings. In ~/.cache there should be only temporary data, not critical in any way. More critical would be in ~/.config, however I am making a guess that ~/.cache/dconfmay contain very recent changes that haven't been added to~/.config` yet. Again, it shouldn't contain critical information and I don't have solid evidence, just a suggestion – Sergiy Kolodyazhnyy Feb 25 '19 at 12:21
  • @SergiyKolodyazhnyy can you please post an answer so that i can accept it? thanks! –  Feb 25 '19 at 12:23
  • 1
    @user110327 I've provided an answer, which should be more or less formal but the question has been asked in the past, so I voted this post to be closed. If you think it doesn't quite fit, let us know. – Sergiy Kolodyazhnyy Feb 25 '19 at 21:25

2 Answers2

0

Yes you can delete all of .cache with no long term detrimental effects.

If your .cache is growing large, it might be better to look at the contents and try to determine what application is making it large and re-configure a bad acting application.


In some case for application's custom configuration may cause problem.For the reason it is bad habit to delete things you do not understand in your home directory, back it up or use a test account.
so have backup and then try

mv .cache .cache_backup
naib khan
  • 101
0

According to XDG specifications:

$XDG_CACHE_HOME defines the base directory relative to which user specific non-essential data files should be stored. If $XDG_CACHE_HOME is either not set or empty, a default equal to $HOME/.cache should be used.

So in other words, it is safe to remove items from it. Most applications only store there data that should be trivial (and of course the emphasis is on should, because it is up to the application to handle what they put in the directory). For instance, Google Chrome and Chromium browsers cache web pages and media in that directory, but significant configuration files are stored in /home/<username>/.config/google-chrome/default. In some cases it's even desirable to remove data in ~/.cache directory, for example for pip to install desired version of package.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497