1

I've been very stupid and while trying to free space on /boot, I think I've accidentally deleted my current kernel.

How it happened:

>>uname -i
linux-image-extra-4.4.0-24-generic

now uname -i only gives:

x86_64

I already tried freeing more space on boot: sudo apt-get autoclean sudo apt-get clean sudo apt-get autoremove

Still has 0 space available.

ls -l \boot gives:

-rw-r--r-- 1 root root  1271765 Dec 18  2015 abi-3.19.0-42-generic
-rw-r--r-- 1 root root  1312645 Mar 11 00:11 abi-4.2.0-34-generic
-rw-r--r-- 1 root root  1313029 Mar 16 00:45 abi-4.2.0-35-generic
-rw-r--r-- 1 root root  1239577 Apr 18 23:21 abi-4.4.0-21-generic
-rw-r--r-- 1 root root  1239612 May 13 00:55 abi-4.4.0-22-generic
-rw-r--r-- 1 root root  1239732 Jun  8 22:39 abi-4.4.0-24-generic
-rw-r--r-- 1 root root  1240018 Jun 24 13:03 abi-4.4.0-28-generic
-rw-r--r-- 1 root root   177800 Dec 18  2015 config-3.19.0-42-generic
-rw-r--r-- 1 root root   184888 Mar 11 00:11 config-4.2.0-34-generic
-rw-r--r-- 1 root root   184888 Mar 16 00:45 config-4.2.0-35-generic
-rw-r--r-- 1 root root   189412 Apr 18 23:21 config-4.4.0-21-generic
-rw-r--r-- 1 root root   189520 May 13 00:55 config-4.4.0-22-generic
-rw-r--r-- 1 root root   189521 Jun  8 22:39 config-4.4.0-24-generic
-rw-r--r-- 1 root root   189533 Jun 24 13:03 config-4.4.0-28-generic
drwxr-xr-x 5 root root     1024 Jun 16 13:35 grub
-rw-r--r-- 1 root root 12326390 Feb 28 20:40 initrd.img-3.19.0-42-generic
-rw-r--r-- 1 root root 12634086 May  3 18:44 initrd.img-4.2.0-34-generic
-rw-r--r-- 1 root root 12645647 May 23 23:23 initrd.img-4.2.0-35-generic
-rw-r--r-- 1 root root 37145299 May  3 18:38 initrd.img-4.4.0-21-generic
-rw-r--r-- 1 root root 37147186 May 29 12:11 initrd.img-4.4.0-22-generic
-rw-r--r-- 1 root root 37147471 Jun 16 13:35 initrd.img-4.4.0-24-generic
drwx------ 2 root root    12288 Sep 21  2015 lost+found
-rw-r--r-- 1 root root   182704 Jan 28 12:44 memtest86+.bin
-rw-r--r-- 1 root root   184380 Jan 28 12:44 memtest86+.elf
-rw-r--r-- 1 root root   184840 Jan 28 12:44 memtest86+_multiboot.bin
-rw------- 1 root root  3622861 Dec 18  2015 System.map-3.19.0-42-generic
-rw------- 1 root root  3744589 Mar 11 00:11 System.map-4.2.0-34-generic
-rw------- 1 root root  3745312 Mar 16 00:45 System.map-4.2.0-35-generic
-rw------- 1 root root  3853719 Apr 18 23:21 System.map-4.4.0-21-generic
-rw------- 1 root root  3855781 May 13 00:55 System.map-4.4.0-22-generic
-rw------- 1 root root  3855383 Jun  8 22:39 System.map-4.4.0-24-generic
-rw------- 1 root root  3859655 Jun 24 13:03 System.map-4.4.0-28-generic
-rw------- 1 root root  6625664 Dec 18  2015 vmlinuz-3.19.0-42-generic
-rw------- 1 root root  6808528 Mar 11 00:11 vmlinuz-4.2.0-34-generic
-rw------- 1 root root  6829104 Mar 16 00:45 vmlinuz-4.2.0-35-generic
-rw------- 1 root root  7013968 Apr 18 23:21 vmlinuz-4.4.0-21-generic
-rw------- 1 root root  7015440 May 13 00:55 vmlinuz-4.4.0-22-generic
-rw------- 1 root root  7020176 Jun  8 22:39 vmlinuz-4.4.0-24-generic
-rw------- 1 root root  7026864 Jun 24 13:03 vmlinuz-4.4.0-28-generic

I tried doing:

sudo apt-get upgrade

but it keeps gettings stuck on no memory. Same with:

sudo apt-get install --reinstall linux-image-4.4.0-24-generic 

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED
  linux-image-extra-4.4.0-21-generic linux-image-extra-4.4.0-22-generic
0 to upgrade, 0 to newly install, 1 reinstalled, 2 to remove and 135 not to upgrade.
8 not fully installed or removed.
Need to get 0 B/18.7 MB of archives.
After this operation, 324 MB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 507715 files and directories currently installed.)
Removing linux-image-extra-4.4.0-21-generic (4.4.0-21.37) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-21-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-21-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-21-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-22-generic (4.4.0-22.40) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-22-generic /boot/vmlinuz-4.4.0-22-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-22-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-22-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-22-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-21-generic
 linux-image-extra-4.4.0-22-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't really understand why my /boot is still full. There are no linux headers in there anymore. Are they cached somewhere?

Any help is greatly appreciated. I don't have a cd drive or something here, so hopefully I can solve this fairly simple...

Otherwise, this might be time for a fresh install. Obviously I am currently backing up my hard drive...

2
  • 1
    No, I posted the commands I got and tried from that page, but those did not work, as the problem is that the apt-get progress is stuck and I need to be able to reinstall my kernel before shutting down.
    – dorien
    Jul 20 '16 at 19:48
  • WIth the addition that the root memory was still full after the deletion (how was that even possible...)
    – dorien
    Jul 20 '16 at 20:14
3

I manually deleted a few config files and initrd files with an old version number.

Then I ran:

sudo apt-get -f install linux-header... NEW VERSION

Worked!

Then to be sure:

sudo apt-get upgrade
0

Try booting from a bootable usb stick or recovery CD then try to find problems or repair disk. If you happen to be using a bootable USB then I would recommend having a look at what "disks" and "Gparted" bring up as issues. After that post what happened and any output errors so that the community can help.

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