19

I'm trying to upgrade Ubuntu to the latest version, and I get this Error:

Not enough free disk space

The upgrade has aborted. The upgrade needs a total of 430 M free space on disk '/boot'. Please free at least an additional 37.8 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.

From gparted I read that my /boot partition is 732 MB, with 425 free. I would have gladly allocated more space to /boot to avoid this issue, but given where I'm at now, here's what I did:

  • I ran sudo apt autoremove --this made no difference.
  • I'm trying to add compression, but the instructions just say set COMPRESS=xz .... Presumably, that means changing the following line in /etc/initramfs-tools/initramfs.conf from this:

COMPRESS=lz4

to this:

COMPRESS=gz

... but then what? Should I save that file and then reboot? Should I log out and log back in again? Should I reinitialize something somewhere with some kind of command? More clarification here would be really helpful. What does it mean to "set" the COMPRESS value and what do I need to do after editing the above file for the changes to take effect?

Jabber1
  • 335
  • 1
  • 3
  • 8
  • 1
    you probably will need to regenerate the initramfs https://askubuntu.com/questions/1351911/what-does-regenerate-your-initramfs-mean – Esther Aug 29 '22 at 15:01
  • Possibly some files never got deleted that should have been; 732MB should be quite enough. can you post output of sudo du -sh /boot/* and uname -a? – Esther Aug 29 '22 at 15:06

2 Answers2

29

Type in the terminal:

sudo nano /etc/initramfs-tools/initramfs.conf

It will open the file in the editor.
Change COMPRESS=zstd to COMPRESS=xz

View screenshot

Then rebuild the images using

sudo update-initramfs -u -k all
  • 3

    " Then rebuild the images using sudo update-initramfs -u -k all"

    <-- That was the crucial missing piece of info. Thank you!

    – Jabber1 Mar 08 '23 at 11:53
4

Also .. try changing

MODULES=most to MODULES=dep

in /etc/initramfs-tools/initramfs.conf followed by

sudo update-initramfs -u -k all

Willem
  • 41