Can I delete /var/log files due to low root space?

It is generally safe to delete log files. The only disadvantage associated with doing so is that you may not be able to examine the log, if you're troubleshooting some other problem later. Since new logs are automatically generated, even this disadvantage is short-lived.

Most logs are deleted automatically (after being rotated by compression and renaming, and kept a while in that archived format). If you have a log that's expanded faster than Ubuntu is deleting it, it's unlikely that you'll experience any problems from deleting it manually.

However, if you have a log file that's 22 gigs in size, something very strange is happening, and it would be worthwhile to investigate that. I recommend editing your question again to include a link to the Ubuntu Forums thread you're talking about, and also to include the full name of the 22 GB log file.


I'd like to add a word of caution here - maybe you can delete all your log files, but you might have problems if you delete the /var/log subdirectories. I deleted all my log files and their directories (rm -r /var/log/*) and it broke my apache2 functionality. Apparently apache doesn't/can't recreate the log directories and therefore can't write log files and that apparently can cause it to fail.

I've heard before that deleting some log files can cause problems, though I don't have any first-hand experience to support it. But of course I didn't have any first-hand experience of directory deletion being a problem until a few days ago...


Further to my original post, I found it easier to use BleachBit (on Root) to clear out all the old logs on my Ubuntu 12.10 desktop; why they get so large I still don't know, but for now BleachBit 'clears all known bits, DEAD!' I reclaimed over 1.6Gig in space. if you find similar log, problems, then check out the BleachBit utility from the Ubuntu Software Resource or Synaptic Package Manager.