在Ubuntu 20.04 LTS上,如何安裝Docker社區版?

分享于 

3分钟阅读

ubuntu

 

问题:

我遇到了以下问题:


 sudo add-apt-repository 


>"deb [arch=amd64] https://download.docker.com/linux/ubuntu 


> $(lsb_release -cs) 


> stable"


[sudo] password for yogesh: 


Hit:1 https://download.docker.com/linux/ubuntu bionic InRelease


Get:2 http://in.archive.ubuntu.com/ubuntu focal InRelease [265 kB] 


Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease 


Ign:4 https://download.docker.com/linux/ubuntu focal InRelease 


Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease 


Hit:6 http://packages.microsoft.com/repos/vscode stable InRelease 


Err:7 https://download.docker.com/linux/ubuntu focal Release 


 404 Not Found [IP: 54.182.0.11 443]


Hit:8 http://dl.google.com/linux/chrome/deb stable Release 


Hit:10 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease


Hit:11 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease


Reading package lists... Done


E: The repository 'https://download.docker.com/linux/ubuntu focal 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.




答案1:

截至今天为止,Ubuntu 20.04 LTS focus的发行文件尚不可用。

您可以在Docker社区码头上更改以下命令:


$ sudo add-apt-repository 


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


 $(lsb_release -cs) 


 stable"




$ sudo add-apt-repository 


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


 bionic 


 stable"



还请确保在安装docker之前从/etc/apt/sources.list中删除以下条目(如果存在)


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




答案2:

另一个选项是安装ubuntu提供的Docker版本:


sudo apt install docker.io



对于Focal,docker.io当前(2020年4月24日)的版本为19.03.8-0ubuntu1,对于大多数Docker工作负载而言这是令人满意的新功能。



COM  COMM  DOC  Docker  DOCK  Ubuntu