0

I'm running Ubuntu Server 16.04 and my upgrade to linux-image-4.4.0-103-generic fails because my /boot directly is almost full (188MB out of 200MB).

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-103-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-103-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-103-generic (--configure):
subprocess installed post-installation script returned error exit status 2
No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-103-generic:
linux-image-extra-4.4.0-103-generic depends on linux-image-4.4.0-103-generic; however:
Package linux-image-4.4.0-103-generic is not configured yet.

dpkg shows that I only have the 2 most recent kernels installed (4.4.0-96-generic and 4.4.0-97-generic).

claude@shannon:~$ sudo dpkg --list 'linux-image*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trigpend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                           Version                    Architecture                 Description
+++-==============================================-============================-    ============================-===================================================    ===============================================
un  linux-image                                    <none>                       <none>                       (no description available)
un  linux-image-4.2.0-27-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.2.0-42-generic                   <none>                       <none>                       (no description available)
iF  linux-image-4.4.0-103-generic                  4.4.0-103.126                amd64                        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
un  linux-image-4.4.0-59-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.4.0-62-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.4.0-63-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.4.0-64-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.4.0-72-generic                   <none>                       <none>                       (no description available)
un  linux-image-4.4.0-77-generic                   <none>                       <none>                       (no description available)
rc  linux-image-4.4.0-81-generic                   4.4.0-81.104                 amd64                        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-4.4.0-83-generic                   4.4.0-83.106                 amd64                        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-96-generic                   4.4.0-96.119                 amd64                        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-97-generic                   4.4.0-97.120                 amd64                        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.2.0-27-generic             4.2.0-27.32~14.04.1          amd64                        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
rc  linux-image-extra-4.2.0-42-generic             4.2.0-42.49~14.04.1          amd64                        Linux kernel extra modules for version 4.2.0 on 64 bit x86 SMP
iU  linux-image-extra-4.4.0-103-generic            4.4.0-103.126                amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-59-generic             4.4.0-59.80                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-62-generic             4.4.0-62.83                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-63-generic             4.4.0-63.84                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-64-generic             4.4.0-64.85                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-72-generic             4.4.0-72.93                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-77-generic             4.4.0-77.98                  amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-81-generic             4.4.0-81.104                 amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
rc  linux-image-extra-4.4.0-83-generic             4.4.0-83.106                 amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-96-generic             4.4.0-96.119                 amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-97-generic             4.4.0-97.120                 amd64                        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-generic                            4.4.0.103.108                amd64                        Generic Linux kernel image

I thought about uninstalling one of them to make room for the new one, but uname -r shows 4.4.0.96-generic as the current kernel, not 4.4.0-97-generic. I'm not sure why the more recent kernel isn't being used, and I don't want to uninstall either one if I don't have to.

claude@shannon:~$ uname -r
4.4.0-96-generic

sudo apt-get autoremove fails because /boot is too full

gzip: stdout: No space left on device
(and so on)

How do I install the latest kernel and remove the old kernel packages?

  • Remove old initrds from /boot by hand. – Ipor Sircer Dec 12 '17 at 18:07
0

You can try to manually mount /dev/sdx /boot (where x is the boot partition, assuming sata is used) and rm the unwanted images.

Keep in mind that the bootloader configuration has to be updated as well. (e.g. assuming grub is used grub-mkconfig /boot/grub/grub.cfg or editing it manually)

0

Ok, I was able to fix it. It turns out the server didn't restart after the prior update to 4.4.0-97-generic, so it was still running 4.4.0-96-generic. I shut down all the services and rebooted, and it made 4.4.0.97-generic the kernel. Then, I ran

sudo apt-get autoremove
sudo apt-get update
sudo apt-get dist-upgrade

and rebooted again. Now 4.4.0-103-generic is the kernel, and 4.4.0-97-generic is the old kernel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.