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-genericDone.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 modeSetting 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-genericAnd here are dkms processes:ps aux | grep dkmsroot     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-genericroot     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-genericroot     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-genericroot     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-genericroot     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 modulesroot     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 modulesroot     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/buildvlastim+ 17701  0.0  0.0  15720  2132 pts/2    S+   12:08   0:00 grep --color=auto dkmsI 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 -rcurrently is:4.4.0-57-genericThe result of:ls -la /lib/modules/`uname -r`/updatescurrently 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.koEDIT2:The result of:ls -la /var/lib/dkmscurrently 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_dbversiondrwxr-xr-x  3 root root 4096 Jan 11 13:52 ndiswrapperdrwxr-xr-x  3 root root 4096 Jan  5 05:23 nvidia-3751.: it is a laptop2.: wifi card is available but currently unused
DKMS stuck while installing new kernel, what shall I do?
linux mint;linux kernel;dkms
First you need to get rid of all those DKMS processes:ps aux | grep dkmsThis will show you what DKMS related processes are running.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/buildThe reason being if you kill e.g. this process:/bin/bash /usr/sbin/dkms autoinstall --kernelver 4.4.0-59-genericYou will have more DKMS processes than before, they will auto respawn.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 17124If it does not help, try:sudo kill -TERM 17124And if that does not kill it, you may finally use:sudo kill -KILL 17124Now you need to remove the lock files:sudo rm /var/lib/apt/lists/locksudo rm /var/cache/apt/archives/locksudo rm /var/lib/dpkg/lockIf that is acceptable for you, you may remove the Nvidia driver:sudo apt-get remove nvidia-375Now finish up the system's updates, which were interrupted:sudo dpkg --configure -asudo apt-get install --fix-brokenRun the Mint's updater:sudo mintupdateOpen up menu View -> Linux kernels.Remove the improperly installed kernel.You may close the kernels' window.If everything went smoothly, you may reboot:sudo reboot