I am unable to install the latest Nvidia drivers for Ubuntu 16.04 on Linux 4.13.

sudo apt-get update
sudo apt-get install nvidia-384 nvidia-384-dev

I get this error, which completely ruins my entire Monday:

Removing old nvidia-384-384.111 DKMS files...
Loading new nvidia-384-384.111 DKMS files...
Error! DKMS tree already contains: nvidia-384-384.111
You cannot add the same module/version combo more than once.
dpkg: error processing package nvidia-384 (--configure):
 subprocess installed post-installation script returned error exit status 3

Here is the full output dump.

I did find a bug report but it appears to be only for 4.15 kernels. Do I need to open a new bug report on launchpad?

I am able to install the 384.111 driver using the .run file downloaded from Nvidia's website. However, I want to use apt-get for install.

Any assistance would be very much appreciated.


Okay I found the issue.

When uninstalling the 1000 nvidia/cuda/cudnn packages, dpkg wont actually remove dkms (Dynamic Kernel Module System) files located in /var/lib/dkms.

Mind boggling that you are required to simply know/intuit this, but Linux demands this of you.

This command solved the problem for me:

sudo rm -rf /var/lib/dkms

After this the normal sudo apt-get install nvidia-384 command executed as expected since dkms didn't fail along the way.

  • 2
    You should be careful with that, as that command will delete the entire dkms directory, which will (could) cause problems the next time there's a kernel update/upgrade. For example, if you have installed VirtualBox, the VirtualBox dkms module will also be in /var/lib/dkms, so VirtualBox will break when your kernel is updated. The correct thing to do would be $ sudo dkms remove nvidia/384.111 --all – Vanessa Deagan Jan 15 '18 at 23:12
  • 1
    good point, though I tried that command at least 10 times and also checked to make sure nvidia was the only thing in the directory first. – jchook Jan 16 '18 at 3:39

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.