1

I'm having issues with updating my kernel running Ubuntu 14.04 on kernel 4.4.0-45-generic. When I run apt-get update followed by apt-get upgrade, my /boot drive runs out of space. I go look at /boot and see that it has installed initrd.img-3.19.0-64-generic through initrd.img-3.19.0-73-generic, which seems unnecessary.

Based on the other files in /boot and the kernel I am running now, I think I should be on initrd.img-4.4.0-57-generic. Thus, I am unsure why upgrade is installing all of these unnecessary initrd.img (it does not install any of the other files for the older kernels).

Following the advice in several places on how to clean /boot, I manually deleted the older initrd.img files and re-run apt-get upgrade. Again, it downloads and installs the same initrd packages, runs out of space, and fails. How can I fix apt upgrade? How to I prevent it from installing old kernels? Any help would be most appreciated. In case it is useful, here is the full output from apt-get upgrade:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic-lts-vivid linux-generic-lts-xenial
  linux-headers-generic-lts-vivid linux-headers-generic-lts-xenial
  linux-image-generic-lts-vivid linux-image-generic-lts-xenial
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
10 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up initramfs-tools (0.103ubuntu4.6) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.19.0-78-generic (3.19.0-78.86~14.04.1) ...
Internal Error: Could not find image (/boot/vmlinuz-3.19.0-78-generic)
dpkg: error processing package linux-image-3.19.0-78-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up linux-firmware (1.127.23) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-42-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-38-generic
grep: /boot/config-4.4.0-38-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-73-generic
grep: /boot/config-3.19.0-73-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-71-generic
grep: /boot/config-3.19.0-71-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-69-generic
grep: /boot/config-3.19.0-69-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-66-generic
grep: /boot/config-3.19.0-66-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-65-generic
grep: /boot/config-3.19.0-65-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-64-generic
grep: /boot/config-3.19.0-64-generic: No such file or directory
update-initramfs: Generating /boot/initrd.img-3.19.0-61-generic
grep: /boot/config-3.19.0-61-generic: No such file or directory

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.19.0-61-generic with 1.
dpkg: error processing package linux-firmware (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-extra-3.19.0-78-generic:
 linux-image-extra-3.19.0-78-generic depends on linux-image-3.19.0-78-generic; however:
  Package linux-image-3.19.0-78-generic is not configured yet.

dpkg: error processing package linux-image-extra-3.19.0-78-generic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic-lts-vivid:
 linux-image-generic-lts-vivid depends on linux-image-3.19.0-78-generic; however:
  Package linux-image-3.19.0-78-generic is not configured yet.
 linux-image-generic-lts-vivid depends on linux-image-extra-3.19.0-78-generic; however:
  Package linux-image-extra-3.19.0-78-generic is not configured yet.
 linux-image-generic-lts-vivid depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic-lts-vivid (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problNo apport report written because the error message indicates its a followup error from a previous failure.
                   No apport report written because MaxReports is reached already
                                                                                 No apport report written because MaxReports is reached already
                                      ems prevent configuration of linux-generic-lts-vivid:
 linux-generic-lts-vivid depends on linux-image-generic-lts-vivid (= 3.19.0.78.60); however:
  Package linux-image-generic-lts-vivid is not configured yet.

dpkg: error processing package linux-generic-lts-vivid (--configure):
 dependency problems - leaving unconfigured
Setting up linux-image-4.4.0-57-generic (4.4.0-57.78~14.04.1) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-57-generic
vmlinuz(/boot/vmlinuz-4.4.0-57-generic
) points to /boot/vmlinuz-4.4.0-57-generic
 (/boot/vmlinuz-4.4.0-57-generic) -- doing nothing at     /var/lib/dpkg/info/linux-image-4.4.0-57-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-57-generic /boot/vmlinuz-4.4.0-57-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-57-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-57-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-57-generic.postinst line 1052.
dpkg: error processing package linux-image-4.4.0-57-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
No apport report written because MaxReports is reached already
                                                          dpkg: dependency problems prevent configuration of linux-image-extra-4.4.0-57-generic:
 linux-image-extra-4.4.0-57-generic depends on linux-image-4.4.0-57-generic; however:
  Package linux-image-4.4.0-57-generic is not configured yet.

dpkg: error processing package linux-image-extra-4.4.0-57-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          No apport report written because MaxReports is reached already
               dpkg: dependency problems prevent configuration of linux-image-generic-lts-xenial:
 linux-image-generic-lts-xenial depends on linux-image-4.4.0-57-generic; however:
  Package linux-image-4.4.0-57-generic is not configured yet.
 linux-image-generic-lts-xenial depends on linux-image-extra-4.4.0-57-generic; however:
  Package linux-image-extra-4.4.0-57-generic is not configured yet.
 linux-image-generic-lts-xenial depends on linux-firmware; however:
  Package linux-firmware is not configured yet.

dpkg: error processing package linux-image-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-xenial:
 linux-generic-lts-xenial depends on linux-image-generic-lts-xenial (= 4.4.0.57.44); however:
  Package linux-image-generic-lts-xenial is not configured yet.

dpkg: error processing package linux-generic-lts-xenial (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                          Processing triggers for initramfs-tools (0.103ubuntu4.6) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-45-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-45-generic with 1.
dpkg: error processing package initramfs-tools (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
                                                          Errors were encountered while processing:
 linux-image-3.19.0-78-generic
 linux-firmware
 linux-image-extra-3.19.0-78-generic
 linux-image-generic-lts-vivid
 linux-generic-lts-vivid
 linux-image-4.4.0-57-generic
 linux-image-extra-4.4.0-57-generic
 linux-image-generic-lts-xenial
 linux-generic-lts-xenial
 initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

EDIT1: I tried to remove old kernels as described here.

It failed with the error message:

Errors were encountered while processing:
 linux-image-extra-3.19.0-64-generic
 linux-image-extra-3.19.0-65-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:

I then found a very similar issue that may be the same or similar to what I'm experiencing. Would manually removing all linux-image-3.19.* from /var/lib/dpkg/info/ be an option? I'm imagining not, but I don't know what else to do.

0

Try this:

Open a terminal,

Press Ctrl+Alt+T

Run it:

sudo -i
dpkg --configure -a
apt-get update
apt-get -f install
OLDCONF=$(dpkg -l|grep “^rc”|awk ‘{print $2}’)
CURKERNEL=$(uname -r|sed ‘s/-*[a-z]//g’|sed ‘s/-386//g’)
LINUXPKG=”linux-(image|headers|ubuntu-modules|restricted-modules)”
METALINUXPKG=”linux-(image|headers|restricted-modules)-(generic|i386|server|common|rt|xen)”
OLDKERNELS=$(dpkg -l|awk ‘{print $2}’|grep -E $LINUXPKG |grep -vE $METALINUXPKG|grep -v $CURKERNEL)
apt-get clean
apt-get purge $OLDCONF
apt-get purge $OLDKERNELS
apt-get autoremove
apt-get dist-upgrade
apt-get clean
  • Thanks for the response @kyodake. That seems to have helped. 4.4.0-59 is now installed and running fine. However, apt-get upgrade is still now trying to install linux-image-3.19.0-78-generic and linux-image-extra-3.19.0-78-generic and failing. So my kernel is up to date now, but my system is still attempting to install old, unneeded kernels. If it changes things at all, I'm trying to get everything up to date so I can run do-release-upgrade. I don't want to run that with system errors, but if I can run it and bypass this issue, that would be great. – mpmbq2 Jan 16 '17 at 16:06
  • Just edited the original post with something else I tried. – mpmbq2 Jan 16 '17 at 18:16
0

I fixed this issue by using synaptic to delete old kernels as described here. The delete process failed several times because a file initrd.img-x.xx.x-xx-generic.old-dkms was created for each kernel being deleted, which caused my /boot partition to run out of space. I manually removed those file to free up space and restarted the removal. All updates and upgrades seem to be working fine now.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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