Ubuntu: I can't delete old kernals [duplicate]



Question:

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!


Solution:1

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


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »