π ~1 min read
Table of contents
Symptom & Impact
Package operations and services fail with no space left on device errors.
Environment & Reproduction
Observed on long-lived hosts with growing logs and caches.
df -h
sudo apt update
journalctl -p err -n 30 --no-pager
Root Cause Analysis
Root volume reaches 100 percent usage due to logs, caches, or old kernels.
Quick Triage
Identify large paths quickly.
sudo du -xhd1 / | sort -h
sudo du -xhd1 /var | sort -h
sudo journalctl --disk-usage
Step-by-Step Diagnosis
Inspect package cache, logs, and stale snap revisions.
sudo du -sh /var/cache/apt/archives /var/log /var/lib/snapd/snaps
snap list --all | awk '/disabled/{print $1, $3}'
ls /boot | grep -E 'vmlinuz|initrd'

Solution – Primary Fix
Free space safely and retry failing operations.
Still having issues? Our Server Management team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo apt clean
sudo journalctl --vacuum-time=7d
sudo apt autoremove -y
for s in $(snap list --all | awk '/disabled/{print $1, $3}'); do sudo snap remove $s; done

Solution – Alternative Approaches
Move high-growth paths to secondary storage.
sudo systemctl stop docker || true
sudo rsync -aHAX /var/lib/docker/ /mnt/data/docker/
sudo mount --bind /mnt/data/docker /var/lib/docker
Verification & Acceptance Criteria
At least 15 percent free space remains and apt works.
df -h /
sudo apt update
sudo apt-get check
Rollback Plan
Revert bind mounts and restore archived logs if needed.
sudo umount /var/lib/docker 2>/dev/null || true
sudo systemctl restart systemd-journald
Prevention & Hardening
Set retention policies and alerts for disk usage thresholds.
sudoedit /etc/systemd/journald.conf
systemctl restart systemd-journald
df -h
Related Errors & Cross-Refs
Can pair with inode exhaustion and failed boot from full /boot.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu storage cleanup and journald retention documentation.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.