Fix: linux kernel update - No space left on device

If adept finishes with errors after kernel-update do the following:

root@fekwhp:~# dpkg --configure -a
Setting up linux-ubuntu-modules-2.6.24-17-generic (2.6.24-17.25) ...
update-initramfs: Generating /boot/initrd.img-2.6.24-17-generic gzip: stdout: No space left on device
update-initramfs: failed for /boot/initrd.img-2.6.24-17-generic
dpkg: error processing linux-ubuntu-modules-2.6.24-17-generic (--configure):
subprocess post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-ubuntu-modules-2.6.24-17-generic; however:
Package linux-ubuntu-modules-2.6.24-17-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 2.6.24.17.19); however:
Package linux-image-generic is not configured yet.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-ubuntu-modules-2.6.24-17-generic
linux-image-generic
linux-generic

Clear the adept cache and check your /boot partition. Probably there’s not enough space left.

root@fekwhp:~# apt-get clean
root@fekwhp:/# df -l /dev/sda1
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda1                35391     31170      2333  94% /boot

In this case there’s definitly not enough space on the /boot partition.

Solution:

1a. remove all backup files from /boot

root@fekwhp:/boot# rm -rf *.bak

or

1b. enlarge your /boot partition using gparted

or

1c. remove old kernel images from /boot

1ca. Open Adept

  1. Filter for linux-image
  2. Locate your old linux-mage from the list for example: linux-image-2.6.xx-xx-generic
  3. Request removal.

1cb. Edit /boot/grub/menu.lst and remove the blocks for old kernel entries.

2. run dpkg again:

root@fekwhp:/boot# dpkg --configure -a
Setting up linux-ubuntu-modules-2.6.24-17-generic (2.6.24-17.25) ...
update-initramfs: Generating /boot/initrd.img-2.6.24-17-generic

Setting up linux-image-generic (2.6.24.17.19) ...
Setting up linux-generic (2.6.24.17.19) ...
Setting up linux-ubuntu-modules-2.6.24-17-generic (2.6.24-17.25) ...

3. Reboot your system.

root@fekwhp:/boot# shutdown -r 0

Now the new kernel should have installed correctly.

4. Check the new kernel version

fengel@fekwhp:~$ uname -r
2.6.24-17-generic

Done.