Sharing Ubuntu19 unable to install docker source problem

  • 2021-07-09 09:36:41
  • OfStack

According to major websites and personal habits, I will use the following method to add Docker sources:


root@ubuntu:~# sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

However, using the above command has brought me endless troubles, and even I doubt whether I am a qualified linux engineer. Using this command prompts the following errors:


Ign:1 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan InRelease

Err:2 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan Release
404 Not Found [IP: 218.104.71.170 443]
Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan InRelease
Hit:4 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease
Hit:5 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
Hit:6 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease
Reading package lists... Done 
E: The repository 'https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan 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.

Here's what's in the apt source file:


deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable 

There are no errors found, but you will find various errors reported when using apt updates, and eventually you don't have the docker-ce installation package you want, or you can't install it:


root@uduntu:~# apt-get update
Get:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]
Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
Get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]
Ign:5 https://download.docker.com/linux/ubuntu eoan InRelease                            
Err:6 https://download.docker.com/linux/ubuntu eoan Release                            
 404 Not Found [IP: 13.225.103.32 443]
Reading package lists... Done                                    
E: The repository 'https://download.docker.com/linux/ubuntu eoan 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.
root@uduntu:~# apt search docker-ce
root@uduntu:~#

I also feel very headache when I encounter this kind of problem. I have found many solutions on the Internet, but I can't. Some people say that it is a network problem that can't use the source code library of the external network. I see this article I am stupid, I also tried to install NetEase, Ali and the source of the University of Science and Technology are not better to solve the problem, in fact, this is very simple to see 1 under the Ali, University of Science and NetEase of their source code library is how to write to the configuration file, and then compared to the gourd painting 1 not finished

Solution:

Add the following one to sources. list:


deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

Update apt source:


root@uduntu:~# apt-get update
Get:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]
Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]
Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
Get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]
Get:5 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB] 
Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [9,594 B] Fetched 511 kB in 11s (48.3 kB/s) 
Reading package lists... Done
root@uduntu:~#

That's good. Don't report any errors. Let's see if the installation package docker-ce has it:


root@uduntu:~# apt search docker-ce
Sorting... Done
Full Text Search... Done
docker-ce/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed]
 Docker: the open-source application container engine

docker-ce-cli/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed,automatic]
 Docker CLI: the open-source application container engine

root@uduntu:~

Summarize


Related articles: