6

As with many questions before, I am running into the error of "not enough free disk space" on /boot for an upgrade from 20.04 LTS to 22.04 via software upgrader. Text:

The upgrade has aborted. The upgrade needs a total of 311 M free space on disk '/boot'. Please free at least an additional 10.4 M of disk space on '/boot'. You can remove old kernels using 'sudo apt autoremove' and you could also set COMPRESS=xz in /etc/initramfs-tools/initramfs.conf to reduce the size of your initramfs.

However, I have done all I have found for clearing /boot, seem to have no old kernels or other things left to remove, and have been unable to resize partitions in gparted.

What I've tried:

  • sudo apt-get autoremove - 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
  • How do I free up more space in /boot? - code results in: 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded
  • http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/ - generally code seems to show I only have operating kernel installed right now
  • resizing in gparted - I'm not very familiar, but it isn't letting me resize any of the partitions to make more room for boot (which is says has 311 of 488Mb free?)
  • Set compress=xz as suggested in the error

What things look like:

dpkg -l linux-{image,headers}-"[0-9]*" 

[115 lines of linux headers - but are these in boot?]

$ dpkg -l linux-* | awk '/^ii/{ print $2 }'
linux-base
linux-firmware
linux-headers-5.4.0-99
linux-headers-5.4.0-99-generic
linux-image-5.4.0-99-generic
linux-libc-dev:amd64
linux-modules-5.4.0-99-generic
linux-modules-extra-5.4.0-99-generic
linux-sound-base

$ uname -r 5.4.0-99-generic

$ ls -l /boot total 154928 -rw-r--r-- 1 root root 237940 Feb 2 2022 config-5.4.0-99-generic drwx------ 3 root root 4096 Dec 31 1969 efi drwxr-xr-x 5 root root 1024 May 18 11:54 grub lrwxrwxrwx 1 root root 27 Feb 17 2022 initrd.img -> initrd.img-5.4.0-99-generic -rw-r--r-- 1 root root 138789943 Sep 1 22:06 initrd.img-5.4.0-99-generic lrwxrwxrwx 1 root root 27 Feb 17 2022 initrd.img.old -> initrd.img-5.4.0-99-generic drwx------ 2 root root 12288 Sep 1 2016 lost+found -rw-r--r-- 1 root root 182704 Aug 18 2020 memtest86+.bin -rw-r--r-- 1 root root 184380 Aug 18 2020 memtest86+.elf -rw-r--r-- 1 root root 184884 Aug 18 2020 memtest86+_multiboot.bin -rw------- 1 root root 4757200 Feb 2 2022 System.map-5.4.0-99-generic lrwxrwxrwx 1 root root 24 Feb 17 2022 vmlinuz -> vmlinuz-5.4.0-99-generic -rw------- 1 root root 13660416 Feb 2 2022 vmlinuz-5.4.0-99-generic lrwxrwxrwx 1 root root 24 Feb 17 2022 vmlinuz.old -> vmlinuz-5.4.0-99-generic

Update/resolution:

ubfan1 pointed out that I needed to run

sudo update-initramfs -u -k all  

to get the compression working as noted in the error suggestion.

After that I was able to get the update installed, but I'm still at 300+ MB with two kernels so I think I'll have to increase the size of boot. As rinzwind pointed out, this has to be done on a live boot of gparted but I haven't tried this yet.

nb137
  • 61

1 Answers1

1

resizing in gparted - I'm not very familiar, but it isn't letting me resize any of the partitions to make more room for boot (which is says has 311 of 488Mb free?)"

A mounted partition can not be resized. You need to use a live session gparted to boot from that and then you can increase /boot (by adding space from an adjecent partition).

If you resize: to err on the safe side 1GiB is a good size.

Rinzwind
  • 309,379