Ask Ubuntu threads on this problem all open with the same two lines: /boot is full and a kernel update fails with No space left on device. It happens on systems with a separate, small /boot partition - a very common Ubuntu install layout, especially with encryption or LVM. Every kernel update adds a new kernel image to /boot but the old ones stay behind, and after enough updates the partition fills completely. Half-finished kernel installs then block dpkg itself, so ordinary updates fail too. The fix is not to delete files by hand. Ubuntu already knows which kernels are old, and apt can purge them cleanly while keeping the kernel you are running and the newest one. This is an Ubuntu and Debian family pattern: Fedora keeps only 3 kernels by default and Arch does not build up /boot this way, so the steps below are written for apt systems.
df -h shows /boot at 100%
gzip: stdout: No space left on device
E: Sub-process /usr/bin/dpkg returned an error code (1) while configuring linux-image
X apt and dpkg fail while configuring a linux-image package, not while downloading it
X df -h /boot shows the /boot partition full or nearly full
X The main disk still has free space - only the small /boot partition is full
/BOOT FULL Old kernels are taking the space, not your files - remove them through apt so the package database stays consistent.
The fingerprint of this problem: the error appears during a kernel update, and only /boot - not the whole disk - is out of space.
Confirm the diagnosis before removing anything. Two quick checks prove that /boot really is the full partition and show you how many kernel versions are installed and taking space in it.
df -h /boot and check the Use percent for /boot. At or near 100 percent with a kernel update failing confirms this problem. Also glance at the root filesystem line so you know the rest of the disk is not full as well.dpkg -l | grep linux-image. On a long-running system you will usually see many versions listed - each one is a kernel image sitting in /boot.uname -r and note that exact version. You will need it in the next fix: the running kernel must never be removed.This is the fix that works, and the safety comes from letting apt decide. Apt knows the running kernel and the newest kernel and keeps both; it purges the older versions properly, updating the bootloader entries and the package database as it goes - none of which happens if you delete files by hand.
sudo apt autoremove --purge and read the list it proposes before confirming. It should list old linux-image and related kernel packages, and it must not list the version shown by uname -r.df -h /boot again afterwards. /boot should now have clear free space for the pending kernel, and dpkg -l | grep linux-image should show a short list: the running kernel and the newest one.Freeing space does not by itself finish the update that failed halfway. The interrupted kernel package is still sitting half-configured in dpkg, so complete that work now while /boot has room.
sudo dpkg --configure -a to configure every package that was left pending by the failed update, including the linux-image package that ran out of space.sudo apt --fix-broken install to repair any dependency left incomplete by the interruption. Let both commands finish without errors before going further.uname -r again and df -h /boot one last time: you should be on the new kernel with /boot comfortably below full.Once it has happened once, it will happen again on a small /boot partition if old kernels are left to accumulate. A short routine after major updates keeps the partition healthy without any risk to the running system.
sudo apt autoremove --purge again as routine housekeeping. Right after a reboot is the safest moment: the previous kernel is no longer the running one, so apt can purge it normally.df -h /boot whenever an update mentions a new linux-image. Thirty seconds of checking is cheaper than another round of No space left errors mid-update.No extra software is needed. The whole fix uses tools already on every Ubuntu and Debian system: df to confirm the full partition, dpkg to list kernels and finish the stuck configuration, uname to identify the running kernel you must keep, and apt with autoremove --purge to remove the old kernels safely. No file manager deletion, no third-party cleaner and no downloaded script is needed - and none of them would keep the package database consistent the way apt does.
Every week: Windows problems, hidden tools and full setup guides, explained step by step.
Subscribe on YouTubeOn Ubuntu installs with a separate small /boot partition, every kernel update installs a new kernel image into /boot while the old versions stay installed. After enough updates those old kernels use the whole partition, so the next linux-image package fails with No space left on device while dpkg is configuring it.
Use sudo apt autoremove --purge. Apt removes all but the running kernel and the newest kernel, and it updates the package database and bootloader entries as it goes. Never delete kernel files from /boot by hand - manual deletion leaves dpkg and the bootloader pointing at files that no longer exist.
Run uname -r before you start and note the exact version. Then read the removal list shown by sudo apt autoremove --purge before confirming: the running version must not be in it. Autoremove keeps the running kernel by design, but checking takes seconds and removes any doubt.
The failed kernel package is still half-configured. Run sudo dpkg --configure -a to finish configuring pending packages, then sudo apt --fix-broken install to repair anything left incomplete. After both finish cleanly, run the update again and reboot onto the properly installed kernel.
Not in this form. Fedora keeps only 3 kernels by default, controlled by installonly_limit in /etc/dnf/dnf.conf, so /boot does not pile up the same way. Arch does not have this separate /boot-full pattern either. This guide and the apt autoremove fix apply to the Ubuntu and Debian family.