Docker installation problem (ubuntu 20.04 LTS) - E: The repository 'https://download.docker.com/linux/ubuntu \ Release' does not have a Release file [closed]
Asked Answered
R

2

6

I have a problem installing docker on my virtual machine. I have followed the steps below:

1. Older versions of Docker were called docker, docker.io, or docker-engine. If these are installed, uninstall them:

sudo apt-get remove docker docker-engine docker.io containerd runc

2. Update the apt package index

sudo apt-get update

3. install packages to allow apt to use a repository over HTTPS:

   sudo apt-get install \
   apt-transport-https \
   ca-certificates \
   curl \
   gnupg \
   lsb-release

4. Add Docker’s official GPG key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

5. Use the following command to set up the stable repository:

   echo \
     "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg]
   https://download.docker.com/linux/ubuntu \
      $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list >
   /dev/null

6. Update the apt package index

sudo apt-get update

At this point - after typing sudo apt-get update - I get the following error

root@xxx:/home/xxx# sudo apt-get update
Hit:1 http://us-central1.gce.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-updates InRelease                                    
Hit:3 http://us-central1.gce.archive.ubuntu.com/ubuntu focal-backports InRelease                                  
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                  
Ign:5 https://download.docker.com/linux/ubuntu \ InRelease                                              
Err:6 https://download.docker.com/linux/ubuntu \ Release
  404  Not Found [IP: 13.249.137.69 443]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu \ Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Content of /etc/apt/sources.list.d/docker.list

deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docker.com/linux/ubuntu \ focal stable

is there a way to fix it?

Raimondo answered 9/8, 2021 at 12:26 Comment(9)
Content of your /etc/apt/sources.list.d/docker.list?Somebody
deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] download.docker.com/linux/ubuntu \ focal stableRaimondo
Well, this is your problem thenSomebody
Should I change focal stable to: deb [arch = amd64] https://download.docker.com/linux/ubuntu eoan stable does it make sense?Raimondo
Hold on, you've edited your last comment, this is not what I was answering to.Somebody
anyway, mine says deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stableSomebody
Yes, sorry. I didn't notice that it was enough to correct the syntax error. Thank you, that's work.Raimondo
No worries, since it worked, I've posted this as the answer, in case it helps someone else in the futureSomebody
FWIW I had the same issue. I was on debian 11 bullseye which is not listed on the docker repository. I followed this installation guide instead of the one on docker site linuxiac.com/how-to-install-docker-on-debian-11-bullseyeRetch
S
15

Make sure the content of the /etc/apt/sources.list.d/docker.list corresponds to the output of the command in the documentation, bullet #3.

At the time of this writing executing the command on my Ubuntu 20.04 LTS results in the following content of the docker.list file:

deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu focal stable

which seems to be different from that of yours.

Somebody answered 9/8, 2021 at 12:48 Comment(2)
This worked for me. As I am using Mint 20.1 I had ulyssa stable, and changing to focal stable fixed the issue. You are perhaps being downvoted as this is noted in bullet 3 of the docs, but I missed it there and found it here, so thank you!Brutality
Thanks for the answer. The #3 point from the link helped me outJollenta
I
0

I was having the same problem,

my docker.list file was

deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu      jammy stable

Too many spaces between /ubuntu and jammy stable... once taking out additional spaces sudo apt-get update worked.

Irredentist answered 24/4, 2023 at 17:39 Comment(1)
FWIW I had the same issue but in my case spaces did not help it. I was on debian 11 bullseye which is not listed on the docker repository. I followed this installation guide instead of the one on docker site linuxiac.com/how-to-install-docker-on-debian-11-bullseyeRetch

© 2022 - 2025 — McMap. All rights reserved.