3

My Ubuntu 17.04 install recently to 4.10.0-21-generic and I was prompted to remove theh 4.10.0-19 kernel. However after running sudo apt autoremove it hangs on this step:

Removing linux-image-extra-4.10.0-19-generic (4.10.0-19.21) ...                                                                                                                                                                 
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic                                                                                                                  
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-19-generic /boot/vmlinuz-4.10.0-19-generic 

Any ideas? I'm unable to install any other packages/update packages as it always tries to remove this to no avail.

Any pointers will be much appreciated.

Output from: dkms status

bbswitch, 0.8, 4.10.0-19-generic, x86_64: installed
bbswitch, 0.8, 4.10.0-20-generic, x86_64: installed
bbswitch, 0.8, 4.10.0-21-generic, x86_64: installed
nvidia-375, 375.66, 4.10.0-20-generic, x86_64: installed
nvidia-375, 375.66, 4.10.0-21-generic, x86_64: installed

Output from ls -l /var/lib/dpkg/info/linux-image-4.10.0-19-generic*

-rw-r--r-- 1 root root  82412 Apr 15 19:19 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.list
-rw-r--r-- 1 root root 101208 Apr  6 18:28 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.md5sums
-rwxr-xr-x 1 root root  40128 Apr  6 18:28 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.postinst
-rwxr-xr-x 1 root root  13691 Apr  6 18:28 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.postrm
-rwxr-xr-x 1 root root  11545 Apr  6 18:28 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.preinst
-rwxr-xr-x 1 root root  11356 Apr  6 18:28 /var/lib/dpkg/info/linux-image-4.10.0-19-generic.prerm
Malachi
  • 1,397

1 Answers1

1

Does the file exist:

/boot/vmlinuz-4.10.0-19-generic 

Exist?

Can you provide the output from?:

$ dkms status
ls -l /var/lib/dpkg/info/linux-image-4.10.0-19-generic*

It looks like the package failed to compile some dkms (Dynamic Kernel Module Support) on install, and it wants to fully configure it before removing the package.

There is the nuclear option but you want to make sure that you are not running on the older kernel or it will break on reboot.

sudo dpkg --remove --force-remove-reinstreq <package_name>
gdahlm
  • 469