Thursday, October 24, 2019

boot - Problems upgrading kernel in ubuntu 14.04

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.

No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...