How to install CUDA on Ubuntu 20.04 Focal Fossa Linux -

The Nvidia CUDA toolkit is an extension of the GPU parallel computing platform and programming model. The Nvidia CUDA installation consists of inclusion of the official Nvidia CUDA repository followed by the installation of relevant meta package and configuring path the the executable CUDA binaries.
This is a companion discussion topic for the original entry at

Unfortunately it did not yet work for me you documented. I get the warning

dpkg: error processing archive /var/cache/apt/archives/libcublas10_10.2.2.89-1_amd64.deb (–unpack):
trying to overwrite ‘/usr/lib/x86_64-linux-gnu/’, which is also in package libnvblas10:amd64 10.1.243-3
Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

Did I miss a step?

I had this happen as well. It may be related to an older version of CUDA being installed, but possibly not. Either way I was able to get past the error by running

  $ sudo dpkg -i --force-overwrite  /var/cache/apt/archives/libcublas10_10.2.2.89-1_amd64.deb

  $ sudo apt --fix-broken install

You will get some warnings after running the first command but the --fix-broken-install clears that right up.


1 Like

sudo apt install nvidia-cuda-toolkit
Reading package lists… Done
Building dependency tree
Reading state information… Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
nvidia-cuda-toolkit : Depends: nvidia-cuda-dev (= 10.1.243-3) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.