📖 ~1 min read
Table of contents
Symptom & Impact
Kernel package installation fails, preventing security updates and potentially leaving unbootable partial upgrades.
Environment & Reproduction
Occurs on systems with small dedicated /boot partitions and many retained kernels.
df -h /boot
uname -r
dpkg -l 'linux-image*' | grep '^ii'
Root Cause Analysis
Old kernel images and initramfs files consume available /boot space needed for new package payloads.
Quick Triage
Identify current and removable kernels quickly.
ls -lh /boot
apt list --installed 'linux-image-*' 2>/dev/null
apt-mark showmanual | grep linux-image
Step-by-Step Diagnosis
Map running kernel to installed packages and select safe cleanup candidates.
current=$(uname -r); echo $current
dpkg -l 'linux-image-[0-9]*' | awk '/^ii/{print $2}'
lsinitramfs /boot/initrd.img-$(uname -r) | head

Solution – Primary Fix
Purge old kernels while keeping current and one fallback kernel.
Still having issues? Our Server Management team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo apt autoremove --purge -y
sudo apt clean
sudo update-grub
df -h /boot

Solution – Alternative Approaches
Manually purge specific old kernel packages when autoremove is conservative.
sudo apt purge -y linux-image- linux-headers-
sudo update-initramfs -u
sudo update-grub
Verification & Acceptance Criteria
Sufficient /boot space exists and pending kernel updates install cleanly.
df -h /boot
sudo apt update
sudo apt install -y --reinstall linux-generic
Rollback Plan
If boot instability appears, reinstall required kernel package from apt cache or repository.
sudo apt install -y linux-image-$(uname -r)
sudo update-grub
Prevention & Hardening
Monitor /boot utilization and automate safe kernel cleanup post-maintenance.
df -h /boot
apt-config dump | grep -i autoremove
systemctl list-timers | grep apt
Related Errors & Cross-Refs
Often linked with initramfs generation failures and interrupted dpkg transactions.
Related tutorial: View the step-by-step tutorial for Ubuntu 26.04 LTS.
View all Ubuntu 26.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Ubuntu kernel package maintenance and recovery 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.