Error with CUDA repository on Ubuntu 20.04

Since a few days, I suddenly get errors trying to use the CUDA repositories on Ubuntu 20.04.
Following the steps from the instructions on a fresh Ubuntu 20.04 system:

echo "deb /" > /etc/apt/sources.list.d/cuda.list
apt-key adv --fetch-keys

I get:

apt-get update
Hit:2 focal InRelease
Get:3 focal-updates InRelease [114 kB]
Get:4 focal-backports InRelease [101 kB]
Get:5 focal-security InRelease [114 kB]
Ign:1  InRelease
Get:6  Release [697 B]
Get:7  Release.gpg [836 B]
Ign:8  Packages
Ign:8  Packages
Ign:8  Packages
Err:8  Packages
  404  Not Found [IP: XXXXXX]
Fetched 330 kB in 1s (392 kB/s)
Reading package lists...
E: Failed to fetch  404  Not Found [IP: XXXXXX]
E: Some index files failed to download. They have been ignored, or old ones used instead.

True enough, the file can not be fetched.

Checking , the file contains:

Acquire-By-Hash: yes

and the hash mentioned above. Am I the only one seeing this, or are the Ubuntu 20.04 repositories broken / is the Acquire-By-Hash feature on mistakenly even though the repo is deployed without it?

1 Like

Thanks for the hint. I have the same problem, and fixed it by adding [by-hash=no] to repository specification:

echo "deb [by-hash=no] /" > /etc/apt/sources.list.d/cuda.list

Thanks, indeed that also works for me! It also fixes things on other Debian-based OSs, I observe the same on Debian 10.
I wonder where’s the best place to raise this as a bug to get it fixed in the actual repository?

I hit the same issue today. Open a support ticket 1 hour ago, seems to be fixed now.

$ sudo apt update
Get:2 focal-security InRelease [114 kB] 
Hit:3 focal InRelease
Hit:6 focal-updates InRelease
Hit:4 focal InRelease
Ign:1  InRelease
Hit:5 focal-updates InRelease
Hit:7  Release
Fetched 114 kB in 0s (258 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
459 packages can be upgraded. Run 'apt list --upgradable' to see them.

Indeed, it seems fixed for Focal now, it seems they have disabled the Acquire-By-Hash setting in the Release file. The Debian 10 repos, however, still have by-hash active:

$ curl -s | tail -n1
Acquire-By-Hash: yes

So Debian 10 is still affected by this.

Hi @olifre, @grzegorz.gutowski, @bruno.travouillon
Yes, Acquire-By-Hash had been set to true for over 1 year for the CUDA Debian and Ubuntu repositories.

For some reason, a few weeks ago it stopped working, only in China, only if using domain redirect: 404 in China when accessing cuda repo (#133) · Issues · nvidia / container-images / cuda · GitLab

Then a couple of days ago, it suddenly stopped working in other regions (with no CDN redirect). As such, for the cuDNN and TensorRT releases that went out yesterday (for select distros), I set this property to False.

Today, I fixed this for the remaining .deb repositories: Debian 10, Ubuntu 14.04, and WSL.


Many thanks! Indeed, that sounds quite mysterious, good to see it fixed!