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
  • Is this all the message you see in the terminal? – George Udosen May 19 '17 at 19:10

Does the file 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>
  • Updated question with provided output. Tried that last command but its hanging again on the same step. Urgh any other suggestions? – Malachi May 20 '17 at 9:09
  • 1
    Sorry I would look for bugs on launchpad, I can't think of any other steps personally that would be safe for your data. Note that in some cases this can be an indication of a file-system or disk error. So I am sorry to that I will have to chicken out on suggesting more invasive options. – gdahlm May 22 '17 at 2:28
  • @Malachi, were you able to solve the problem? I have exactly the same problem as you except that the result of ls -l /var/lib/dpkg/info/linux-image-4.10.0-19* does not result isn any file. I have thus open a new question here: askubuntu.com/questions/1015475/… . If you have any idea of how I could solve this, please let met know! Thx. – Wraf Mar 16 '18 at 13:54

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.