0

Hopefully, this is not a duplicate question. I tried searching for answers before posting, but I'm pretty new to Linux and I couldn't find anything that I could understand. I might need some ELI5 help.

I'm running Ubuntu 16.04. I've got a full boot drive. I determined that it's because there are A LOT of extra kernels that I really don't need.

At least 23 extra kernels:

The thing is, when I try to remove the oldest (I think it's the oldest. It's the one with the lowest number) using:

sudo apt-get autoremove linux-image-4.4.0-31-generic

This error is thrown multiple times:

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-75-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-75-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-92-generic (4.4.0-92.115) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-92-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-92-generic /boot/vmlinuz-4.4.0-92-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-92-generic /boot/vmlinuz-4.4.0-92-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-92-generic /boot/vmlinuz-4.4.0-92-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-92-generic
depmod: WARNING: could not open /var/tmp/mkinitramfs_AjLDSQ/lib/modules/4.4.0-92-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_AjLDSQ/lib/modules/4.4.0-92-generic/modules.builtin: No such file or directory

I'm not sure if I'm reading this right, but I think it's saying that I need more space in order to clear up space. I have no idea what to do. Please help me.

I'm sure anyone wanting to help me will need more information. Please let me know if you do. I'm just sorry I can't anticipate them.

And thank you!

  • sudo apt clean && sudo apt autoclean && sudo apt autoremove -y usually works for me. – Sirajus Salekin Oct 30 '17 at 04:58
  • "sudo apt clean && sudo apt autoclean && sudo apt autoremove -y" Threw the same errors as above – Bladewright Oct 30 '17 at 05:05
  • 1
    Not to sound rash but I don't seem to understand why we never do a sudo apt-get autoremove as usually recommended by an update and eventually get a full boot partition – George Udosen Oct 30 '17 at 05:10
  • I fixed my problem by manually deleting files I was absolutely sure I didn't need from my boot directory. After this, I was able to delete the old kernels using Synaptic Package Manager.

    I do have one more concern though. The dpkg --list | grep linux-image command like in the image above still gives the same output. How do I delete those?

    – Bladewright Oct 30 '17 at 06:20

1 Answers1

-1

You can try sudo purge-old-kernels (utility from byobu package).
Then sudo apt-get autoremove.

N0rbert
  • 99,918