0

I am on Linux Mint 18.1 Cinnamon 64-bit.

DKMS seems to be stuck while installing new kernel for 30 minutes now, what shall I do?

Kill the DKMS process? And then run dpkg --configure -a?

Here is the mintupdate log:

(Reading database ... 317520 files and directories currently installed.)
Preparing to unpack .../adobe-flashplugin_1%3a20170110.1-0ubuntu0.16.04.1_amd64.deb ...
Unpacking adobe-flashplugin (1:20170110.1-0ubuntu0.16.04.1) over (1:20161213.1-0ubuntu0.16.04.1) ...
Preparing to unpack .../libwebkit2gtk-4.0-37_2.14.2-0ubuntu0.16.04.1_amd64.deb ...
Unpacking libwebkit2gtk-4.0-37:amd64 (2.14.2-0ubuntu0.16.04.1) over (2.12.5-0ubuntu0.16.04.1) ...
Preparing to unpack .../libjavascriptcoregtk-4.0-18_2.14.2-0ubuntu0.16.04.1_amd64.deb ...
Unpacking libjavascriptcoregtk-4.0-18:amd64 (2.14.2-0ubuntu0.16.04.1) over (2.12.5-0ubuntu0.16.04.1) ...
Preparing to unpack .../gir1.2-webkit2-4.0_2.14.2-0ubuntu0.16.04.1_amd64.deb ...
Unpacking gir1.2-webkit2-4.0:amd64 (2.14.2-0ubuntu0.16.04.1) over (2.12.5-0ubuntu0.16.04.1) ...
Preparing to unpack .../gir1.2-javascriptcoregtk-4.0_2.14.2-0ubuntu0.16.04.1_amd64.deb ...
Unpacking gir1.2-javascriptcoregtk-4.0:amd64 (2.14.2-0ubuntu0.16.04.1) over (2.12.5-0ubuntu0.16.04.1) ...
Selecting previously unselected package linux-headers-4.4.0-59.
Preparing to unpack .../linux-headers-4.4.0-59_4.4.0-59.80_all.deb ...
Unpacking linux-headers-4.4.0-59 (4.4.0-59.80) ...
Selecting previously unselected package linux-headers-4.4.0-59-generic.
Preparing to unpack .../linux-headers-4.4.0-59-generic_4.4.0-59.80_amd64.deb ...
Unpacking linux-headers-4.4.0-59-generic (4.4.0-59.80) ...
Selecting previously unselected package linux-image-4.4.0-59-generic.
Preparing to unpack .../linux-image-4.4.0-59-generic_4.4.0-59.80_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.4.0-59-generic /boot/vmlinuz-4.4.0-59-generic
Done.
Unpacking linux-image-4.4.0-59-generic (4.4.0-59.80) ...
Selecting previously unselected package linux-image-extra-4.4.0-59-generic.
Preparing to unpack .../linux-image-extra-4.4.0-59-generic_4.4.0-59.80_amd64.deb ...
Unpacking linux-image-extra-4.4.0-59-generic (4.4.0-59.80) ...
Preparing to unpack .../linux-libc-dev_4.4.0-59.80_amd64.deb ...
Unpacking linux-libc-dev:amd64 (4.4.0-59.80) over (4.4.0-57.78) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for mintsystem (8.3.0) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
Setting up adobe-flashplugin (1:20170110.1-0ubuntu0.16.04.1) ...
update-alternatives: using /usr/lib/adobe-flashplugin/libflashplayer.so to provide /usr/lib/mozilla/plugins/flashplugin-alternative.so (mozilla-flashplugin) in auto mode
Setting up libjavascriptcoregtk-4.0-18:amd64 (2.14.2-0ubuntu0.16.04.1) ...
Setting up libwebkit2gtk-4.0-37:amd64 (2.14.2-0ubuntu0.16.04.1) ...
Setting up gir1.2-javascriptcoregtk-4.0:amd64 (2.14.2-0ubuntu0.16.04.1) ...
Setting up gir1.2-webkit2-4.0:amd64 (2.14.2-0ubuntu0.16.04.1) ...
Setting up linux-headers-4.4.0-59 (4.4.0-59.80) ...
Setting up linux-headers-4.4.0-59-generic (4.4.0-59.80) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.4.0-59-generic /boot/vmlinuz-4.4.0-59-generic

And here are dkms processes:

ps aux | grep dkms

root     13671  0.0  0.0  10124  2268 pts/1    S+   11:54   0:00 /bin/sh /usr/lib/dkms/dkms_autoinstaller start 4.4.0-59-generic
root     13677  0.0  0.0  18540  5840 pts/1    S+   11:54   0:00 /bin/bash /usr/sbin/dkms autoinstall --kernelver 4.4.0-59-generic
root     16419  0.0  0.0  18580  5636 pts/1    S+   11:55   0:00 /bin/bash /usr/sbin/dkms autoinstall --kernelver 4.4.0-59-generic
root     16807  0.0  0.0  18600  4956 pts/1    S+   11:55   0:00 /bin/bash /usr/sbin/dkms autoinstall --kernelver 4.4.0-59-generic
root     16813  0.0  0.0  10124  1904 pts/1    S+   11:55   0:00 /bin/sh -c make "CC=cc"  KBUILD_VERBOSE= -C /lib/modules/4.4.0-59-generic/build M=/var/lib/dkms/nvidia-375/375.26/build ARCH=x86_64 NV_KERNEL_SOURCES=/lib/modules/4.4.0-59-generic/build NV_KERNEL_OUTPUT=/lib/modules/4.4.0-59-generic/build NV_KERNEL_MODULES="nvidia nvidia-uvm nvidia-modeset nvidia-drm" INSTALL_MOD_DIR=kernel/drivers/video modules
root     16814  0.0  0.0  14296  3828 pts/1    S+   11:55   0:00 make CC=cc KBUILD_VERBOSE= -C /lib/modules/4.4.0-59-generic/build M=/var/lib/dkms/nvidia-375/375.26/build ARCH=x86_64 NV_KERNEL_SOURCES=/lib/modules/4.4.0-59-generic/build NV_KERNEL_OUTPUT=/lib/modules/4.4.0-59-generic/build NV_KERNEL_MODULES=nvidia nvidia-uvm nvidia-modeset nvidia-drm INSTALL_MOD_DIR=kernel/drivers/video modules
root     17124  0.0  0.0  15272  4776 pts/1    S+   11:55   0:00 make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia-375/375.26/build
vlastim+ 17701  0.0  0.0  15720  2132 pts/2    S+   12:08   0:00 grep --color=auto dkms

I have noticed it is probably caused by the Nvidia driver, but both the driver and kernel worked together flawlessly until today's update.

How do I revert this update?

EDIT1:

uname -r

currently is:

4.4.0-57-generic

The result of:

ls -la /lib/modules/`uname -r`/updates

currently is:

drwxr-xr-x 2 root root   4096 Dec 20 21:42 .
drwxr-xr-x 7 root root   4096 Jan  5 05:23 ..
-rw-r--r-- 1 root root 482872 Dec 20 21:42 ndiswrapper.ko

EDIT2:

The result of:

ls -la /var/lib/dkms

currently is:

drwxr-xr-x  5 root root 4096 Jan  5 05:22 .
drwxr-xr-x 96 root root 4096 Jan  6 06:38 ..
drwxr-xr-x  3 root root 4096 Jan 11 13:51 bbswitch
-rw-r--r--  1 root root    6 Jul  8  2008 dkms_dbversion
drwxr-xr-x  3 root root 4096 Jan 11 13:52 ndiswrapper
drwxr-xr-x  3 root root 4096 Jan  5 05:23 nvidia-375

1.: it is a laptop

2.: wifi card is available but currently unused

  • Fill a bugreport: bugs.launchpad.net/linuxmint – Ipor Sircer Jan 11 '17 at 11:21
  • What have you got down the directory ls -la /lib/modules/`uname -r`/updates ? – Rui F Ribeiro Jan 11 '17 at 14:03
  • I was trying to remember something, and your output just made me remember it... do ls -la /var/lib/dkms ; ndiswrapper...is it a notebook with a non-linux wifi card? – Rui F Ribeiro Jan 11 '17 at 15:01
  • As you can see, on which installation of a new kernel version, you are compiling bbswitch + ndiswrapper + nvidia-375. It is bound to take time. Do you still need that? – Rui F Ribeiro Jan 11 '17 at 15:06
  • Some time later then. To make an educated guess, I would say you are two hours ahead of me. In the meanwhile I would advise to try to understand wether you need to compile those 3 kernel modules, or if there are alternatives ; if you do not need a module there, it is enough to move that directory to another place just to keep the backup. – Rui F Ribeiro Jan 11 '17 at 15:11
1
  1. First you need to get rid of all those DKMS processes:

    ps aux | grep dkms
    

    This will show you what DKMS related processes are running.

  2. Don't kill those recklessly, you need to identify this process or all such processes:

    make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia-375/375.26/build
    

    The reason being if you kill e.g. this process:

    /bin/bash /usr/sbin/dkms autoinstall --kernelver 4.4.0-59-generic
    

    You will have more DKMS processes than before, they will auto respawn.

  3. Once you have identified the process ID(s) you need to get rid of, proceed with caution, let's try out soft and even softer kill first, for the sake of this example, I use 17124 process ID:

    sudo kill -HUP 17124
    

    If it does not help, try:

    sudo kill -TERM 17124
    

    And if that does not kill it, you may finally use:

    sudo kill -KILL 17124
    
  4. Now you need to remove the lock files:

    sudo rm /var/lib/apt/lists/lock
    sudo rm /var/cache/apt/archives/lock
    sudo rm /var/lib/dpkg/lock
    
  5. If that is acceptable for you, you may remove the Nvidia driver:

    sudo apt-get remove nvidia-375
    
  6. Now finish up the system's updates, which were interrupted:

    sudo dpkg --configure -a
    
    sudo apt-get install --fix-broken
    
  7. Run the Mint's updater:

    sudo mintupdate
    
  8. Open up menu View -> Linux kernels.

    Remove the improperly installed kernel.

    You may close the kernels' window.

  9. If everything went smoothly, you may reboot:

    sudo reboot
    
  • It seens odd deleting so many lock files – Rui F Ribeiro Jan 13 '17 at 5:37
  • you may get way with a dpkg-reconfigure to the kernel package instead of deleting it – Rui F Ribeiro Jan 13 '17 at 5:40
  • @RuiFRibeiro Yes it may look akward, but I had found out no other way. What would I do with dpkg-reconfigure in particular? (If it happens again) – LinuxSecurityFreak Jan 18 '17 at 14:28
  • well, for instance, a dpkg-reconfigure linux-image-4.8.0-2-amd64 takes care of the grub and reinstall part of the kernel package, including the dkms phase of the kernel automagically. – Rui F Ribeiro Jan 18 '17 at 15:16
0

Based on your comments I understand you want to fix this on a very short term. The best option is probably to not install the latest kernel, or to rollback to the old situation. Please see the answer here, it's about Debian, but should apply to Mint as well: Can I rollback an apt-get upgrade if something goes wrong?

What you encounter happens quite often with the commercial Nvidia drivers. If you use one of the latest kernels (like Mint does) it often takes several weeks before the Nvidia driver is up to date as well.

As an alternative: Did you try the Nouveau open source drivers? Those aren't great in 3D and special features, but for normal Office use they work fine: https://nouveau.freedesktop.org/wiki/

I don't have Mint installed, so I hope somebody knows a good trick for you to get this working. Good luck!

0

I experienced an update hanging at the same place. In my case, I simply needed to wait. It took a very long time, but it did finally continue with the update. DKMS recompiles drivers, and software compilation can take a very long time.

I did note that /boot was getting low on space, and that may have been slowing things down. The update did seem slow overall.

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.