# depmod hangs while trying to install nVidia's drivers



## hellrazor (Aug 25, 2018)

```
hellrazor@eldritch:~$ sudo apt install nvidia-driver
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  nvidia-kernel-dkms
The following NEW packages will be installed:
  nvidia-driver nvidia-kernel-dkms
0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded.
Need to get 0 B/9,323 kB of archives.
After this operation, 27.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Selecting previously unselected package nvidia-kernel-dkms.
(Reading database ... 313020 files and directories currently installed.)
Preparing to unpack .../nvidia-kernel-dkms_390.77-1_amd64.deb ...
Unpacking nvidia-kernel-dkms (390.77-1) ...
Selecting previously unselected package nvidia-driver.
Preparing to unpack .../nvidia-driver_390.77-1_amd64.deb ...
Unpacking nvidia-driver (390.77-1) ...
Setting up nvidia-kernel-dkms (390.77-1) ...
Loading new nvidia-current-390.77 DKMS files...
Building for 4.17.0-3-amd64
Building initial module for 4.17.0-3-amd64
Done.

nvidia-current.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-3-amd64/updates/dkms/

nvidia-current-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-3-amd64/updates/dkms/

nvidia-current-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-3-amd64/updates/dkms/

nvidia-current-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-3-amd64/updates/dkms/

depmod...
```

'bout the gist of it.


----------



## re0 (Aug 25, 2018)

Which distribution are you using? Also, are the specifications for this build the ones listed on your profile?


----------



## hellrazor (Aug 25, 2018)

Debian Buster, and yeah.


----------



## re0 (Aug 25, 2018)

I personally don't use and haven't used Linux with NVIDIA for a while, so I do not know how much help I can be. I had a quick Google search using the kernel version and driver version but couldn't see anything related.

The output doesn't seem to give much indication to what the problem could be. However, perhaps you could grep from dmesg after it hangs? Something like:

```
dmesg | grep depmod
```


----------



## hellrazor (Aug 26, 2018)

Nope, doesn't come up with anything.


----------



## ictoo (Aug 28, 2018)

It's not an isolated issue; mine hangs at the exact same stage:



```
root@Carly:~# apt install -y ocl-icd-libopencl1 nvidia-driver nvidia-cuda-toolkit
E: dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem.
root@Carly:~# dpkg --configure -a
Processing triggers for glx-alternative-nvidia (0.8.7) ...
update-alternatives: using /usr/lib/nvidia to provide /usr/lib/glx (glx) in auto mode
Setting up nvidia-kernel-dkms (390.77-1) ...
Removing old nvidia-current-390.77 DKMS files...

-------- Uninstall Beginning --------
Module:  nvidia-current
Version: 390.77
Kernel:  4.17.0-kali3-amd64 (x86_64)
-------------------------------------

Status: Before uninstall, this module version was ACTIVE on this kernel.

nvidia-current.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.17.0-kali3-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-modeset.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.17.0-kali3-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-drm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.17.0-kali3-amd64/updates/dkms/
rmdir: failed to remove 'updates/dkms': Directory not empty
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.


nvidia-current-uvm.ko:
 - Uninstallation
   - Deleting from: /lib/modules/4.17.0-kali3-amd64/updates/dkms/
 - Original module
   - No original module was found for this module on this kernel.
   - Use the dkms install command to reinstall any previous module version.

depmod...

DKMS: uninstall completed.

------------------------------
Deleting module version: 390.77
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-current-390.77 DKMS files...
Building for 4.17.0-kali3-amd64
Building initial module for 4.17.0-kali3-amd64
Done.

nvidia-current.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-kali3-amd64/updates/dkms/

nvidia-current-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-kali3-amd64/updates/dkms/

nvidia-current-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-kali3-amd64/updates/dkms/

nvidia-current-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.17.0-kali3-amd64/updates/dkms/

depmod...
```

It seems to create the file okay, but can't seem to finalize installation: 





Permissions all look good as well. I will keep digging after work and will post back if I find a solution.


----------



## hellrazor (Aug 28, 2018)

Okay. Well, I "solved" the issue by purging the drivers and installing the ones from nVidia's website. I had to tell it to not make a DKMS module or it would also freeze - so maybe it's a DKMS thing, I don't know.


----------



## ictoo (Aug 28, 2018)

Edit: fixed sentence structure

That [the solution] coincides with something I read up on before I had to go to work - that the ABIs in the new kernel aren't compatible. It was all a bit out of my area of expertise, but seems to make sense being solved by installing straight from nVidia:





> *Installation*





> *Kernel*
> 
> As mentioned above, the NVIDIA kernel driver installs and runs against the current kernel. It builds as a module, so the kernel must support the loading of kernel modules (see below).
> The kernel module (nvidia.ko) consists of a proprietary part (commonly known as the "binary blob") which drives the graphics chip(s), and an open source part (the "glue") which at runtime acts as intermediary between the proprietary part and the kernel. These all need to work nicely together as otherwise the user might be faced with data loss (through kernel panics, X servers crashing with unsaved data in X applications) and even hardware failure (overheating and other power management related issues should spring to mind).
> ...


 https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers


----------



## MarcosRC (Sep 23, 2018)

I have the same issue.

Apparently it may be because you have some older linux-headers or linux-source installed, but I have purged both and reinstalled the latest (same as linux-image) and still not installing.


----------



## baryluk (Nov 5, 2018)

It is really weird. I never had issue with depmod.

Do you see depmod in process list when it is hanging? Is it consuming CPU or idle? Maybe depmod crashed and dkms do not handle that error case correctly. There should dkms logs somewhere in /var


----------

