简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM