I am trying to install CUDA in Ubuntu 18.04.3 LTS according to this documentation from nvidia.
I ran into trouble when I tried to install linux headers by the following command.
sudo apt-get install linux-headers-$(uname -r)
It raised an Unmet dependencies error.
The following packages have unmet dependencies:
libcuinj64-9.1 : Depends: libcuda1 (>= 387.26) or
libcuda-9.1-1
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
When I tried
sudo apt --fix-broken install
I got
dpkg: error processing archive /var/cache/apt/archives/libnvidia-compute-430_430.26-0ubuntu0.18.04.2_amd64.deb (--unpack):
trying to overwrite '/usr/lib/x86_64-linux-gnu/libnvidia-ml.so', which is also in package nvidia-340 340.107-0ubuntu0.18.04.3
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-compute-430_430.26-0ubuntu0.18.04.2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
The whole terminal output can be seen here.
This is the gpu I have
*-display
description: VGA compatible controller
product: GM204 [GeForce GTX 970]
vendor: NVIDIA Corporation
physical id: 0
bus info: pci@0000:01:00.0
version: a1
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
configuration: driver=nouveau latency=0
resources: irq:29 memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff
I am not sure where to go from here. Can anyone help?
linux-headers-4.15.0-64-generic is already the newest version (4.15.0-64.73)., which is usually preinstalled. The documentation says to check forlinux-headersbefore installing cuda, which you seem to have followed backwards. Something else must have caused the "unmet dependencies" error, which you'll need to undo. Also, thenouveaudriver is up, while it should be blacklisted, and I see no nvidia driver installed. – mikewhatever Oct 07 '19 at 21:44