sorry for ot, for my ubuntu 16.04, all of a sudden, my user partition is 100% used, what’s wrong and how to free it up?
thanks.
did a bit of googling,
/boot
has
54MB intrig-img-4.15.0-29-generic
54MB intrig-img-4.15.0-36-generic
uname -a
indicates that it’s on/using 4.15.0-36-generic
does it mean I can safely delete intrig-img-4.15.0-29-generic ?
would rm -rf that file better or
sudo dpkg -r that file better?
and last time when I df it had at least 6 GB free before my sucker windows 10 crashed then of course all the VMs on it too, would that explain it? tks again
rm will get rid of the file, but it’ll still be there in the packages database, and you’ll miss the related files (i.e. /lib/modules/4.15.0-29-generic is likely FAR bigger than 54MB)
However it’s unlikely 54MB is killing your drive. You’re better off using du as I indicated to identify the big offending directories/files.
Post df to start.
To delete old kernels, dpkg -l 'linux-*' … You’ll see packages like linux-image-4.15.0-29-generic, linux-image-extra-4.15.0-29-generic, etc. Pass those into apt-get purge.
apt-cache policy linux-image-generic |grep Candidate: shows what the most recent kernel in the repo is. uname -a shows what you’re running.
If you did du -mxs /* |sort -nr, now do du -mxs /usr/* |sort -nr or /var/* or whatever.
Linux reserves approx 5% of filesystems for use by root and root alone, so even if you have “free bytes” the percentage will only show what non-root users can use.
So of a 15GB volume only 14.25G is available for non-root. You should probably trim some more
If you can’t find more stuff to trim there are things you may not need.
/usr/share/doc is all documentation
/usr/share/man is all manpages. If you aren’t using manpages you can dump them. (you can find them all online anyway)
/var/log tends to grow - especially if you don’t have logrotation on one or a couple files. If you delete a file from /var/log, just be aware if the file descriptor is still open (i.e. syslog has it open) the space will NOT be released. It would after you restart the service holding the file open, or you reboot.
Joe, thank you so much, previously i’ve looked at the /var/temp directory and googling seems to confirm stuff can be deleted there, so, I did, but that did not seem help much.
But removing stuff from these two directories and their subdirectories of /usr/share/doc and its /man helps A LOT, now I have 5G free.
Well, a new issue just popped up, that is, our cloud service provider, Digital Ocean, seems to have misconfigured the “|” process redirect command for the “console” access to a Ubuntu 16.04 server, thus, instead of redirecting the current process output to another, it redirects current process output to a file, and I’m not sure what else could go wrong…
“console” access is preferable to “ssh” for our current work. I’ve brought up the issue with them, but not sure what they’ll do …
Be sure to NOT use the volumes option if you want to preserve volumes.
If you want an interactive mode then don’t use the --all switch. See link above, which shows:
$ docker system prune
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all dangling images
- all build cache