Install specific CUDA version on Ubuntu 18.04

Hi all,

My code is having problems with the latest CUDA release (10.1.243) and I therefore want to downgrade back to 10.1.168. The problem I am having doing this is indeed similar to a a previous post (, yet does not seem to work here.

What I am generally trying to do is uninstall all existing packages, then download the old deb file and reinstall the old version. The problem is that even after the following steps (especially line 10), Ubuntu keeps installing the 10.1.243 version instead of 10.1.168.

My steps are the follwing:

sudo apt-get --purge -y remove 'cuda*'
sudo apt-get --purge -y remove 'nvidia*'
sudo apt autoremove -y
sudo apt-get clean


sudo dpkg -i cuda-repo-ubuntu1804_10.1.168-1_amd64.deb
sudo apt-key adv --fetch-keys
sudo apt-get install cuda-10-1=10.1.168-1

Is there something else I have to do to make Ubuntu install that specific version or am I missing something else? Thanks for your help!

It appears that when choosing a specific version for meta-packages like cuda-10-1, it only changes the version of the meta-package but not of all dependencies. All packages belonging to the meta-package are thus installed in the default version which is 10.1.243. The same does for instance also apply when choosing the cuda-drivers meta-package.