Remove CUDA 10.0 and install CUDA 9.2 on Ubuntu 18.04

Viewed 13025

I'm trying to install TensorFlow-gpu, so I need the CUDA toolkit 9.2. Unfortunately I installed CUDA 10 and then realized that.

How can I easily remove CUDA 10.0 and install CUDA 9.2, without touching the drivers (since I have Ubuntu 18 I would like to maintain the latest video drivers)?

  • I already tried to simple install CUDA 9.2 from .deb (network) file, it says

dpkg: error processing archive cuda-repo-ubuntu1710_9.2.148-1_amd64.deb (--install):

trying to overwrite '/etc/apt/sources.list.d/cuda.list', which is also in package cuda-repo-ubuntu1804 10.0.130-1

  • I already tried to simple install CUDA 9.2 from .run file as described here, it says

Not enough space on parition mounted at /tmp. Need 2895511552 bytes.

Disk space check has failed. Installation cannot continue.

3 Answers

+1 to installing a stand-alone CUDA-9.2 in a separate dir using .run installer. That should work.

You can specify an alternative location for the temporary files using --tmpdir=... option when you run the .run installer.

I solved this issue as follow :

sudo apt-get purge nvidia*
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /usr/local/cuda-10.0

This will remove cuda-10.0 and then you can install cuda-9.2 as you want

I have solved the problem using @Cs20 answer and doing:

sudo dpkg -P <package name>

in this case <package name> is cuda-repo-ubuntu1804

Related