I have been installing various versions of CUDA this way for years:
sudo apt-get update
sudo apt-get purge cuda --yes
# eg for 9.0:
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
sudo apt-get install cuda=9.0.176-1 --yes
This has always worked well, I had that in a script that would automatically setup my CI machines. But today I noticed that things aren't working anymore:
sudo apt-get install cuda=9.0.176-1 --yes
E: Unable to locate package cuda
Apparently, the GPG key expired: https://github.com/NVIDIA/nvidia-docker/issues/1081#issuecomment-533717708
To solve this, you now need to do:
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
But still, same error! I tried with CUDA version 10.0 as well but it fails in the same way.
This works:
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt update
sudo apt install cuda-10-0 --yes
The same approach works for CUDA 9.0. Not sure why my previous approach doesn't work anymore.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With