# Error with CUDA repository on Ubuntu 20.04

**URL:** <https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023>\
**Category:** CUDA Setup and Installation\
**Created:** [August 31, 2021, 12:09am UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023 "2021-08-31T00:09:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![olifre](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/olifre/32/62203_2.png) [@olifre](https://forums.developer.nvidia.com/u/olifre)\
**Post date:** [August 31, 2021, 12:09am UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/1 "2021-08-31T00:09:10Z")

</div>

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:

```auto
echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list
apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub

```

I get:

```auto
apt-get update
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Ign:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Release [697 B]
Get:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Release.gpg [836 B]
Ign:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages
Ign:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages
Ign:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages
Err:8 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages
  404 Not Found [IP: XXXXXX]
Fetched 330 kB in 1s (392 kB/s)
Reading package lists...
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/by-hash/SHA256/751939d95516afc289908a19e447f0acc1506367f72ed356431a2b1a469cc8ca 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 `https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/by-hash/SHA256/751939d95516afc289908a19e447f0acc1506367f72ed356431a2b1a469cc8ca` can not be fetched.

Checking [https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86\_64/Release](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Release) , the file contains:

```auto
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?

---

<div class="post-metadata">

**Author:** ![grzegorz.gutowski](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/grzegorz.gutowski/32/120245_2.png) [@grzegorz.gutowski](https://forums.developer.nvidia.com/u/grzegorz.gutowski)\
**Post date:** [September 1, 2021, 10:13am UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/2 "2021-09-01T10:13:19Z")

</div>

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

```auto
echo "deb [by-hash=no] http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" > /etc/apt/sources.list.d/cuda.list

```

---

<div class="post-metadata">

**Author:** ![olifre](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/olifre/32/62203_2.png) [@olifre](https://forums.developer.nvidia.com/u/olifre)\
**Post date:** [September 1, 2021, 10:04pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/3 "2021-09-01T22:04:57Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![bruno.travouillon](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruno.travouillon](https://forums.developer.nvidia.com/u/bruno.travouillon)\
**Post date:** [September 2, 2021, 8:03pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/4 "2021-09-02T20:03:41Z")

</div>

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

```auto
$ sudo apt update
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] 
Hit:3 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:6 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 https://repo.download.nvidia.com/baseos/ubuntu/focal/x86_64 focal InRelease
Ign:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 InRelease
Hit:5 https://repo.download.nvidia.com/baseos/ubuntu/focal/x86_64 focal-updates InRelease
Hit:7 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 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.

```

---

<div class="post-metadata">

**Author:** ![olifre](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/olifre/32/62203_2.png) [@olifre](https://forums.developer.nvidia.com/u/olifre)\
**Post date:** [September 2, 2021, 8:18pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/5 "2021-09-02T20:18:41Z")

</div>

Thanks!  
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:

```auto
$ curl -s https://developer.download.nvidia.com/compute/cuda/repos/debian10/x86_64/Release | tail -n1
Acquire-By-Hash: yes

```

So Debian 10 is still affected by this.

---

<div class="post-metadata">

**Author:** ![kmittman](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kmittman/32/39694_2.png) [@kmittman](https://forums.developer.nvidia.com/u/kmittman)\
**Post date:** [September 3, 2021, 5:36pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/6 "2021-09-03T17:36:55Z")

</div>

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 `.com` → `.cn` domain redirect: [404 in China when accessing cuda repo (#133) · Issues · nvidia / container-images / cuda · GitLab](https://gitlab.com/nvidia/container-images/cuda/-/issues/133)

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.

---

<div class="post-metadata">

**Author:** ![olifre](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/olifre/32/62203_2.png) [@olifre](https://forums.developer.nvidia.com/u/olifre)\
**Post date:** [September 3, 2021, 6:53pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/7 "2021-09-03T18:53:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 12, 2021, 4:04pm UTC](https://forums.developer.nvidia.com/t/error-with-cuda-repository-on-ubuntu-20-04/188023/8 "2021-10-12T16:04:07Z")

</div>


