I am running out of space on the disk '/boot'. When trying to use the software updater, a message appears suggesting to remove old kernels using sudo apt autoremove
, and to set COMPRESS=xz
in initramfs.conf
.
Similarly to this question, sudo apt autoremove
did not make a difference. Then, I tried with the second alternative.
However, after setting COMPRESS=xz
, I need to rebuild the initramfs.conf image. For this I use sudo update-initramfs -u -k all
(as suggested in the answer of the above post/question), but it does not work due to lack of space. The output is the folllowing:
I: The initramfs will attempt to resume from /dev/dm-2
I: (/dev/mapper/vgubuntu-swap_1)
I: Set the RESUME variable to override this.
xz: (stdout): Write error: No space left on device
E: mkinitramfs failure xz --check=crc32 --threads=0 1
update-initramfs: failed for /boot/initrd.img-5.15.0-67-generic with 1.
/boot
partition. – Artur Meinild Mar 20 '23 at 11:14\boot
partition?? – Miguel Mar 20 '23 at 11:17apt purge
sometimes helps, but probably neither of those if /boot is separate. Maybe look and see if there are files in /boot that belong to kernels that are not "installed" that should have been deleted. Or (carefully!!) delete the oldest one that isn't in use... Ultimately, you probably need to resize the partition. – user10489 Mar 20 '23 at 11:25/boot/initrd.img-5.14.0-1055-oem
that I think is not in use, since when I rununame -a
, the output is a more recent image5.14.0-1057-oem
. Does this mean that I can safely delete the5.14.0-1055-oem
image? Or do I need to check something else before? – Miguel Mar 20 '23 at 11:30dpkg -l | grep
followed byapt remove
to clean up the rest. – user10489 Mar 20 '23 at 22:14linux-image-x.x.x-x-generic
. I made sure I removed the one that had a version number, not the Generic Linux kernel image (hwe-20.04
) – Miguel Mar 29 '23 at 13:30uname -r
. Regarding the machine not booting because all kernel images were removed, I'd try booting to rescue mode from grub boot menu, and in rescue mode attempt to install a kernel. – Randall Whitman Sep 01 '23 at 16:29