GPG error during CUDA 10 installation on ubuntu 14.04


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

apt-key adv --fetch-keys
apt-add-repository "deb /" 
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  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 xenial-security main" >> /etc/apt/sources.list
echo "deb 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 -P /tmp
apt-key add /tmp/

# add nvidia link to apt sources
apt-add-repository "deb /"

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