I've been trying to install Cuda 10.0 and tensrflow 2.0 in Ubuntu 19.10 (the same goes for the previous versions of Ubuntu), but there is no use. It says that the package 418 (althouh I ask explicitly for 410) is not configured and the insalling crashes. I also tried to purge the 418 version and reinstall it, but it doesn't work either.

I already tried several resouces such this and this one but no success. Any idea on how to solve this?


Installing Cuda 10 from the repositories, I had problems with unmet dependencies. After a lot of troubleshooting the sequence that worked for me was:

sudo apt install nvidia-driver-435
sudo apt install nvidia-cuda-toolkit

Then I had Cuda 10 installed. I don't know if this solves your problems with tensorflow.


Use default driver for Nvidia GPU

then install Package "nvidia-cuda-toolkit"(10.1.168-1build1) for Ubuntu eoan

➜  ~ sudo apt install nvidia-cuda-toolkit -y

➜  ~ which nvcc

➜  ~ nvcc --version 
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Wed_Apr_24_19:10:27_PDT_2019
Cuda compilation tools, release 10.1, V10.1.168



You first need to install gcc-7 and g++-7 since CUDA 10 only works with version 7. In case you have other gcc/g++ versions installed - the default on Ubuntu 19.10 should be 9 - you should do something like the following:

  • sudo apt-get install gcc-7 g++-7
  • sudo update-alternatives --remove-all gcc
  • sudo update-alternatives --remove-all g++
  • sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 50
  • sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 50
  • sudo update-alternatives --config gcc
  • sudo update-alternatives --config g++

Detailed explanation for this step can be found here.

Now for installing NVIDIA drivers, CUDA toolkit, and cuDNN:

Following this post (that you already mentioned you tried), I recently managed to install CUDA 10.1 and TensorFlow 2.1.0 with GPU support for a machine running on Ubuntu 19.10 with 4 RTX 2070S GPUs. I used sudo apt-get install nvidia-driver-440 for installing the drivers (I was working on a clean install of Ubuntu so there were no previously installed drivers, but you can try sudo apt-get remove --purge '^nvidia-.*' to remove existing drivers) and after that for cuDNN I followed instructions here but of course for cuDNN-10.1. I used this tarball instead of the debian package.

Make sure you pay attention to versions. TensorFlow 2.1.0 DOES NOT work with CUDA 10.2 - you should use 10.1. The same goes for cuDNN.


for installation of cuda 10.0 on ubuntu 18.04/19.10:

see github link: install cuda on ubuntu 18.04

and tensorflow :

 pip3 install tensorflow tensorflow-gpu
  • I already tried this, but it doesn't work...
    – Gabs
    Oct 23 '19 at 17:53
  • @Gabs try it on fresh-installed ubuntu. i have tested 18.04, 19.10 both works fine for me. Oct 24 '19 at 8:09

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.