Find it before deleting anything. Two commands answer almost every case.
df -h # which filesystem is full
sudo du -xh / | sort -h | tail -40
The -x matters — it stops du wandering into other mounted filesystems and giving you a total that means nothing. If you have an interactive tool available, ncdu -x / is the same information you can walk around in, and it is worth installing while you still have the space to install it.
The usual culprits, in the order I find them:
- Logs. Systemd's journal grows until told not to.
journalctl --disk-usagereports it andjournalctl --vacuum-size=200Mtrims it, permanently once you set the limit in the configuration. - The package cache. Every distribution keeps downloaded packages after installing them. Clearing it is entirely safe.
- Old kernels, which is the same problem as a full boot partition.
- Container images and volumes, which is usually the answer on a machine running anything containerised.