LINUXMAKER, OpenSource, Tutorials

The directory, the partition /var/ has no more free space

The /var directory on UNIX and Linux is a directory for changing "variable" files, hence the directory name. It is best if the design of the server architecture has already created a sufficiently large and separate partition for / var. Nevertheless, it happens that this directory is full. In most cases, less the log files are the causers than the directories of the respective package manager or, if set up, backup files that are cached there.

The cause can be explored in this way

Determination of memory consumption from "/"

du -h --max-depth=1 /

Determination of the largest consumers below "/ var / cache /"

du /var/cache/* | sort -n

Determination of the other access to "/ var / cache"

lsof -Pn +D /var/cache/ | awk '{print $1}' | sort | uniq

Troubleshooting

After "/var/cache/apt/" emerged as a space junker, this solution is a useful one.

apt-get autoclean
apt-get autoremove
apt-get clean