I tried installing cuda 10.2 using apt. Halfway the installation there was an error. I was able to directly install running the .run file from the Nvidea website. However now when doing:

$ sudo apt upgrade

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-libraries-dev-10-2 : Depends: libcublas-dev (>= but it is not installed
 cuda-samples-10-2 : Depends: libcublas-dev (>= but it is not installed
 cuda-visual-tools-10-2 : Depends: libcublas-dev (>= but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

Then when doing:

$ sudo apt --fix-broken install

I get:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libllvm7 libllvm7:i386 libnvidia-common-390 libwayland-client0:i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
The following NEW packages will be installed
0 to upgrade, 1 to newly install, 0 to remove and 33 not to upgrade.
62 not fully installed or removed.
Need to get 0 B/42.3 MB of archives.
After this operation, 114 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 file:/var/cuda-repo-10-2-local-10.2.89-440.33.01  libcublas-dev [42.3 MB]
(Reading database ... 473743 files and directories currently installed.)
Preparing to unpack .../libcublas-dev_10.2.2.89-1_amd64.deb ...
Unpacking libcublas-dev ( ...
dpkg: error processing archive /var/cuda-repo-10-2-local-10.2.89-440.33.01/./libcublas-dev_10.2.2.89-1_amd64.deb (--unpack):
 trying to overwrite '/usr/include/nvblas.h', which is also in package nvidia-cuda-dev 9.1.85-3ubuntu1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

When doing:

$nvcc --version

I get:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Oct_23_19:24:38_PDT_2019
Cuda compilation tools, release 10.2, V10.2.89

Any ideas on how to fix the broken packages?


Ok, I was able to find a solution online:

1) I switched prime profiles to intel. 2) moved cuda.list file somewhere else (the 10.2 version that I had installed) 3) Commented lines in .bashrc where it pointed path to cuda 10.2 (not sure if necessary) 4) rebooted 5) $ sudo apt --fix-broken install

(and that worked this time!)

6) switched prime profile back to nvidia 7) uncommented lines in .bashrc (reverse step 3) 8) $ source .bashrc

And it worked. I have now cuda 10.2 installed and apt no longer has broken dependencies. :-)

| improve this answer | |
  • Hello @Flilpe . Could you give the full path cuda.list. – Samim Aftab Ahmed Jan 20 at 19:57

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.