Disk is full
A full root filesystem causes failed updates, failed logins, and sometimes a machine that will not boot. Find what is using space before you delete.
Where is it full?
df -hT
sudo du -xh / --max-depth=2 2>/dev/null | sort -h | tail -n 20
df shows each mount. / at 100% is the emergency. A full /boot (small partition, old kernels) looks like “apt cannot install linux-image.” A full /home is different from a full /.
Safe first cuts
sudo journalctl --vacuum-time=7d
sudo apt clean
sudo apt autoremove --purge
Journals in /var/log/journal routinely eat gigabytes. apt clean only drops cached .deb files, not installed programs.
Old kernels and snaps
dpkg -l 'linux-image-*' | grep ^ii
snap list
du -sh /var/lib/snapd/snaps 2>/dev/null
Leave the current kernel and one previous. Remove the rest with apt, not by deleting files in /boot by hand. Snaps keep revisions; sudo snap set system refresh.retain=2 limits that on Ubuntu.
What not to delete
- Do not
rm -rfanything under/usror/var/lib/dpkg. - Do not empty
/var/lib/mysqlor Docker volumes unless you mean to destroy that data. - Large files in
/var/wwwor/homemay be the actual website or your documents — look withdufirst.
If df says 100% but du does not add up, a deleted file is still held open by a process. sudo lsof +L1 finds it; restart that service.