Tell me more ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am running out of disk space and noted that I have a large /var/cache directory. Can I safely remove this? (using Arch Linux, BTW).

share|improve this question
3  
I'd check through what's in there, but given that's where pacman store's it's packages you might want to run pacman -Sc or even pacman -Scc if you want to clean your entire package cache. – xenoterracide Oct 23 '11 at 20:02
Most, but not all, files under /var/cache are safe to delete. Don't delete the directories or change their ownership. Run du /var/cache/* | sort -n to see what's taking room. Ask here if you don't know whether the large directories are safe to clean. – Gilles Oct 24 '11 at 1:14
What about a disk usage analyzer - alternativeto.net/software/windirstat/?platform=linux – Aaron Newton Jan 12 at 6:28

2 Answers

up vote 6 down vote accepted

No.

For one, I believe that /var/cache/bind/ is the default directory where bind9 expects its zone files to be stored (at least on Debian; I don't know offhand if other distros follow suit)

For another, according to this documentation, pacman (the package manager used by Arch linux) stores its package cache under /var/cache/pacman/pkg/ and it most likely expects nothing but itself to modify the contents.

I recommend you read through the documentation more closely and decide whether this is a good time to clear the package cache.

share|improve this answer

From http://www.lindevdoc.org/wiki//var/cache

Sorry for the (very) late answer, but I believe it's important to include this bit for future reference.

Highlighted the bit which does answer this question.

The /var/cache directory contains cached files, i.e. files that were generated and can be re-generated any time, but they are worth storing to save time of recomputing them.

Any application can create a file or directory here. It is assumed that files stored here are not critical, so the system can delete the contents of /var/cache either periodically, or when its contents get too large.

Any application should take into account that the file stored here can disappear any time, and be ready to recompute its contents (with some time penalty).

So yes, you may remove these files without expecting anything bad to happen.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.