1

I tried to install a package (jsonlint) via apt-get on a Xubuntu 15.10 system and it failed due to an error installing linux-image-4.2.0-25-generic . This was a new, clean install of 15.10, Jan 15 2016

I tried standalone

sudo apt-get install linux-image-4.2.0-25-generic

and it fails. I also cannot remove linux-image-4.2.0-25-generic. linux-image-4.2.0-23-generic is active in /boot and boots correctly via grub, but these broken -25 artifacts prevent updates.

Can't remove or install kernel did not help

below are my logs from trying install/remove. I don't use lilo, so I'm not sure what those errors mean or how to ignore them.

How can I clean this up so I can install other packages? apt-get --force-yes sounds dangerous; is there a better way?

I tried to remove after prior install failed:

$ uname -r
4.2.0-23-generic
$ sudo apt-get update
...
$ sudo apt-get remove linux-image-4.2.0-25-generic
(Reading database ... 208105 files and directories currently installed.)
Removing linux-generic (4.2.0.25.27) ...
Removing linux-image-generic (4.2.0.25.27) ...
Removing linux-image-extra-4.2.0-25-generic (4.2.0-25.30) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-runlilo 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Warning: LBA32 addressing assumed
Fatal: raid_setup: stat("/dev/sdb")
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1
dpkg: error processing package linux-image-extra-4.2.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.2.0-25-generic (4.2.0-25.30) ...
Examining /etc/kernel/prerm.d.
run-parts: executing /etc/kernel/prerm.d/dkms 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
dkms: removing: vboxhost 5.0.12 (4.2.0-25-generic) (x86_64)

-------- Uninstall Beginning --------
Module:  vboxhost
Version: 5.0.12
Kernel:  4.2.0-25-generic (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

vboxdrv.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.2.0-25-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetflt.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.2.0-25-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxnetadp.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.2.0-25-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


vboxpci.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.2.0-25-generic/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod....

DKMS: uninstall completed.
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-25-generic
run-parts: executing /etc/kernel/postrm.d/zz-runlilo 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Warning: LBA32 addressing assumed
Fatal: raid_setup: stat("/dev/sdb")
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.2.0-23-generic
Found initrd image: /boot/initrd.img-4.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 14.04.3 LTS (14.04) on /dev/sda5
done
The link /vmlinuz is a damaged link
Removing symbolic link vmlinuz
 you may need to re-run your boot loader[grub]
The link /initrd.img is a damaged link
Removing symbolic link initrd.img
 you may need to re-run your boot loader[grub]
Removing linux-firmware (1.149.3) ...
Errors were encountered while processing:
 linux-image-extra-4.2.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Failed to perform requested operation on package.  Trying to recover:

Current status: 1 (+1) broken.

I tried to install to see if that would patch it:

$ sudo apt-get install linux-image-4.2.0-25-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  fdutils linux-doc-4.2.0 linux-source-4.2.0 linux-tools
The following packages will be REMOVED:
  linux-image-extra-4.2.0-25-generic
The following NEW packages will be installed:
  linux-image-4.2.0-25-generic
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/17.3 MB of archives.
After this operation, 112 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
debconf: falling back to frontend: Readline
(Reading database ... 201526 files and directories currently installed.)
Removing linux-image-extra-4.2.0-25-generic (4.2.0-25.30) ...
depmod: FATAL: could not load /boot/System.map-4.2.0-25-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-25-generic
depmod: WARNING: could not open /var/tmp/mkinitramfs_2vAXLr/lib/modules/4.2.0-25-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_2vAXLr/lib/modules/4.2.0-25-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-runlilo 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Warning: LBA32 addressing assumed
Fatal: raid_setup: stat("/dev/sdb")
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1
dpkg: error processing package linux-image-extra-4.2.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.2.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

and I tried again to remove it:

$ sudo apt-get remove linux-image-4.2.0-25-generic
Building dependency tree
Reading state information... Done
Package 'linux-image-4.2.0-25-generic' is not installed, so not removed
The following packages will be REMOVED:
  linux-image-extra-4.2.0-25-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 162 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 201526 files and directories currently installed.)
Removing linux-image-extra-4.2.0-25-generic (4.2.0-25.30) ...
depmod: FATAL: could not load /boot/System.map-4.2.0-25-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
update-initramfs: Generating /boot/initrd.img-4.2.0-25-generic
depmod: WARNING: could not open /var/tmp/mkinitramfs_RhzV1u/lib/modules/4.2.0-25-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_RhzV1u/lib/modules/4.2.0-25-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-runlilo 4.2.0-25-generic /boot/vmlinuz-4.2.0-25-generic
Warning: LBA32 addressing assumed
Fatal: raid_setup: stat("/dev/sdb")
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1
dpkg: error processing package linux-image-extra-4.2.0-25-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.2.0-25-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

for additional info:

$ apt-cache policy linux-image-generic
linux-image-generic:
  Installed: (none)
  Candidate: 4.2.0.25.27
  Version table:
     4.2.0.25.27 0
        500 http://us.archive.ubuntu.com/ubuntu/ wily-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ wily-security/main amd64 Packages
     4.2.0.16.18 0
        500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
3
  • You said you tried askubuntu.com/questions/723556/cant-remove-or-install-kernel. Does it mean you are able to install the 4.2.0-25 kernel without any issues?
    – Marcus
    Jan 29, 2016 at 17:35
  • I tried to install jsonlint which tried to install 4.2.0-25 but failed. Since then, I cannot install or remove 4.2.0-25. It is partially installed but failed, and now I can't complete the install or remove it (P.S. I've done sudo apt-get update).
    – djb
    Jan 29, 2016 at 19:15
  • When I do apt-cache policy linux-image-generic I get linux-image-generic: Installed: 4.4.0.22.23 Candidate: 4.4.0.22.23 Version table: *** 4.4.0.22.23 500 500 http://mirrors.digitalocean.com/ubuntu xenial-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 100 /var/lib/dpkg/status 4.4.0.21.22 500 500 http://mirrors.digitalocean.com/ubuntu xenial/main amd64 Packages . But when I do uname -r I get 4.2.0-25-generic . Any idea about this?
    – kwoxer
    Jun 4, 2016 at 19:10

1 Answer 1

0

I think I solved my problem -- I dug into those failure logs and saw some lilo errors.

Fatal: raid_setup: stat("/dev/sdb")
run-parts: /etc/kernel/postinst.d/zz-runlilo exited with return code 1

I (thought) was not using lilo because it failed during the Ubuntu install and I switched to grub instead. but apparently the system thinks lilo is installed/active. The /etc/lilo.conf file pointed to old locations. I renamed my /etc/lilo.conf file and reran liloconfig and now dpkg does not crash trying to uninstall 4.2.0-25 or install other packages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .