GPG error during CUDA 10 installation on ubuntu 14.04

Hi,

I’m currently using the following script in my Ubuntu 14.04 machine to install CUDA 10:

apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub
apt-add-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /" 
apt-get update
apt install -y cuda-10-0

This has been running fine for the last year or so, but it started failing recently with the following message:

Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/Packages  gnutls_handshake() failed: Handshake failed
Unable to locate package cuda-10-0

From the error message and some Googling, there were some hints that the TLS toolchain on Ubuntu 14.04 might be too old for the nvidia package servers, which could be causing the handshake to fail and package to be missing when the install command is run. But I’m not sure why this had suddenly stopped working recently.

Is there any workaround to this problem? I’m currently in a bit of a conundrum where I can’t upgrade my system to a newer version of the Ubuntu for another 6 months (due to another dependency).

Found a workaround, which was to upgrade curl by pulling it from xenial repos. Here’s script that I ran to fix the issue:

# add xenial repos to sources.list
echo "deb http://security.ubuntu.com/ubuntu xenial-security main" >> /etc/apt/sources.list
echo "deb http://cz.archive.ubuntu.com/ubuntu xenial main universe" >> /etc/apt/sources.list

# upgrade curl from the xeinal repo
apt-get update
apt-get install -y curl

# remove xenial repos from sources.list
head -n -2 /etc/apt/sources.list | tee /etc/apt/sources.list

# retrieve and add gpg keys from nvidia
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/7fa2af80.pub -P /tmp
apt-key add /tmp/7fa2af80.pub

# add nvidia link to apt sources
apt-add-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 /"

# install cuda 10
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y cuda-10-0