nvidia-390 driver error during installation on Ubuntu 18.04

Hi,

I’m trying to install CUDA on Ubuntu 18.04, following this video : https://www.youtube.com/watch?v=vxjbL5iN1XY

This is not my first attempt. I’ve followed other guides without success.

When I run

sudo apt install nvidia-390

, this is what I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 cuda-drivers : Depends: nvidia-396 (>= 396.44) but it is not going to be installed
 libcuda1-396 : Depends: nvidia-396 (>= 396.44) but it is not going to be installed
 nvidia-390 : Depends: nvidia-driver-390 but it is not going to be installed
 nvidia-396-dev : Depends: nvidia-396 (>= 396.44) but it is not going to be installed
 nvidia-opencl-icd-396 : Depends: nvidia-396 (>= 396.44) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

When I run

sudo apt --fix-broken install

, this is what I get:

Preparing to unpack .../nvidia-396_396.44-0ubuntu1_amd64.deb ...
Unpacking nvidia-396 (396.44-0ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-396_396.44-0ubuntu1_amd64.deb (--unpack):
 trying to overwrite '/sbin/create-uvm-dev-node', which is also in package nvidia-kernel-common-390 390.48-0ubuntu3
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-396_396.44-0ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I guess there’s an issue with nvidia-396 (which I’ve installed during a previous attempt). The command “nvidia-smi” never worked by the way. What should I do ? How can I remove the package nvidia-396 ? How can I fix it ?

I managed to solve this by running:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/nvidia-396_396.44-0ubuntu1_amd64.deb

I’ve had to do this to fix this recurring error since I installed the drivers directly from nVidia.

Hope this helps.

Installing Cuda anything on Ubuntu 18.04 is tricky and a major pain-in-the-a$$. It would be nice if we could finally get support for this from Nvidia. I wish there was less new stuff from Nvidia and more getting their existing development tools ported to the major new Ubuntu platform. Sigh…

Anyway, I have successfully installed and run Cuda 9.0, cuDNN, Tensorflow, Keras, dLib and OpenCV 3.4.1 on Ubuntu 18.04. After bricking my system twice trying so of the other suggested installation methods I found the easiest and most reliable way is to installer a version of the Ubuntu 18.04 server then add a desktop manager. You do not install everything just enough.

If you follow https://www.pugetsystems.com/labs/hpc/The-Best-Way-To-Install-Ubuntu-18-04-with-NVIDIA-Drivers-and-any-Desktop-Flavor-1178/ this exactly as he states it is quite easy to get going. There is a new post on install 9.2 https://www.pugetsystems.com/labs/hpc/How-to-install-CUDA-9-2-on-Ubuntu-18-04-1184/#step-1-get-ubuntu-1804-installed available now.

Good luck,
Doug

I had the same problem. Happened when I did software update. I couldn’t even log in. Tried many things. Eventually, I used advance Ubuntu manual to reboot into the recovery mode of the version before the update, then repeat the update. It solved the problem.

It was really annoying, in the end with force installation i was able to. Thanks