My software updater got stuck while installing the linux kernel 4.10.0-38. When I killed the process and run sudo dpkg --configure -a, I got:

Setting up linux-headers-4.10.0-38-generic (4.10.0-38.42) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic

And then nothing happened for a very long time. When I press control + C, I got:

Failed to process /etc/kernel/header_postinst.d at /var/lib/dpkg/info/linux-headers-4.10.0-38-generic.postinst line 110.
dpkg: error processing package linux-headers-4.10.0-38-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
Setting up linux-image-4.10.0-38-generic (4.10.0-38.42) ...
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-38-generic
) points to /boot/vmlinuz-4.10.0-38-generic
 (/boot/vmlinuz-4.10.0-38-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.10.0-38-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-38-generic /boot/vmlinuz-4.10.0-38-generic

And it got stuck again. Then I press control + C again, I got:

Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.10.0-38-generic.postinst line 1052.
dpkg: error processing package linux-image-4.10.0-38-generic (--configure):
 subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-headers-generic:
 linux-headers-generic depends on linux-headers-4.10.0-38-generic; however:
  Package linux-headers-4.10.0-38-generic is not configured yet.

dpkg: error processing package linux-headers-generic (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:

Then I run sudo dpkg --config -a and got:

The following packages have been unpacked but not yet configured.
They must be configured using dpkg --configure or the configure
menu option in dselect for them to work:
 linux-headers-generic Generic Linux kernel headers

The following packages are only half configured, probably due to problems
configuring them the first time.  The configuration should be retried using
dpkg --configure <package> or the configure menu option in dselect:
 linux-headers-4.10.0-38-generic Linux kernel headers for version 4.10.0 on 64 
 linux-image-4.10.0-38-generic Linux kernel image for version 4.10.0 on 64 bit 

Now I can't install anything using apt, because whenever I use apt, it will try to configure the kernel and get stuck again. I also need to manually select kernel every time I boot my computer because the default 4.10.0-38 kernel didn't work. How can I fix that?

I tried this solution by replacing all 4.4.0-38 in commands with 4.10.0-38, but it didn't work.

Now my /var/lib/dpkg/status is:

Package: linux-image-extra-4.10.0-38-generic
Status: deinstall ok config-files
Priority: optional
Section: kernel
Installed-Size: 151751
Maintainer: Ubuntu Kernel Team <kernel-team@lists.ubuntu.com>
Architecture: amd64
Source: linux
Version: 4.10.0-38.42
Depends: linux-image-4.10.0-38-generic, crda | wireless-crda

P.S. I'm using nvidia driver and have VirtualBox installed. However, I don't have the /etc/kernel/postinst.d/vboxadd file.


similar with me - got stuck while updating to linux kernel 4.10.0-38. When nothing happened for a long time I restarted the computer. But not even the restart was successfull, I could only restart in advanced mode, selecting the Ubuntu, with linux 4.8.0-36-generic option, (non of the linux 4.8.10 option led to a successfull restart.)

For me this helped: askubuntu.com/questions/253244/reinstall-latest-kernel based on this I tried this: sudo apt-get install --reinstall linux-image-generic linux-image-4.8.0-36-generic It took time (0,5-1 hour) to install, but reboot was successfull afterwards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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