What's the best strategy to keep /var from filling up?

I’ve substantially cleaned out my /home directory, deleted all trash, etc. but /var is still 84% full and has triggered warnings in the past. I tried a simple restart to see if that cleared temp data but there was no change. I’ve seen suggestions about logrotate but is that the ideal solution? How about cd var > $CLEANUP ? A related concern is how to remove or avoid unwanted fonts e.g. Abyssinian? There seem to be a ton of these.

Fonts are stored in two places, in your home folder
~/.fonts
and in root
/usr/share/fonts

For your /var syslog filling, you will want to know what is causing errors that are filling the log. Clear your log to

  • create some free space
  • isolate the latest and most probable errors causing it to fill

sudo cat /dev/null > /var/log/syslog

Next use the tail command to check the log a while after clearing it out to see the last entries and see what new errors are persistent

tail -f /var/log/syslog

1 Like

[result:] bash: /var/log/syslog: Permission denied.
I tried entering my password on sudo apt remove and then tried the quoted string again but am still denied, with no further password challenge.
It’d be great to clear the logs as they occupy about 730MB.

Could you please try:

sudo -i

Enter PW then

cat /dev/null > /var/log/syslog

All I get is this:

cliff@cliff-Latitude-E5430-non-vPro:~$ sudo -i
[sudo] password for cliff:
\root@cliff-Latitude-E5430-non-vPro:~# cat /dev/null > /var/log/syslog
root@cliff-Latitude-E5430-non-vPro:~# tail -f /var/log/syslog

doesn’t seem to invoke any visible actions on the logs

1 Like

Cliffe, you rock.

This is one of those things I learned early on but never bothered to question.
A bit like when you run ‘sudo apt clean’ and it does not do anything fancy in terminal- when I would run the above in elevated terminal, I assumed it did what I intended it to do.
My assumption was incorrect and it goes to show why we must always question our assumptions or accept correction from others.

I found this Ask Ubuntu thread which explains it:

Thanks. I went through those posts and tried the more recent ones, which may have worked tho not visibly on the terminal window. However, still get warnings that /var is nearly full despite these and other measures like removing a number of snaps (e.g. games) from /var/lib which should’ve increased var free space but hasn’t. Ultimately, I’ve GOT to teach myself how to expand the partition using Gparted. I saved your earlier instructions. Been in hospital, but hope to focus on that soon.

1 Like

Hope you are well, or at least healthy enough to tolerate living.
Can I ask, how large is your home partition?

Although I usually shun GUI frills, I admit I use simple “ubuntu-cleaner” on my machine when I feel like being lazy. It clears out thumbnails, apt-cache, old kernels and the like. Frees up some space. I do it once a week just to do it.

Hey thanks, I’ll see if I can find that! My /home ptn was set at 20GB when I installed Zorin last Jan. I don’t recall seeing other options. I kind of assumed my whole 320GB hard drive would be utilized and available but as it turned out there are at least a couple hundred GB I can’t access.
Health challenges persist but I can still very much appreciate being alive. Thanks for asking.

With 15.3 Core in a confined root partition, I am keeping an eye on creeping occupation, or should I call it infestation.
I have discovered that my var/lib/snapd contains over 500MB. Are those normal and necessary occupants for Core? If true I will say no more, as it is not a serious problem (yet).
snaps0

In a chance encounter, I stumbled across this entry in a search:

I will admit to something here: I removed snapd. I removed everything associated with it.
This has not caused me any problems, yet.

1 Like

That askabuntu link was interesting, but focused on wifi towards the end.
It did have a link to this 6yr old thread:

Crosslink to Swarfendors post about removing snapd

Any important distinction here between removing and disabling?