问题描述
我正在尝试在the official installation guide之后在Ubuntu 64计算机上安装Docker。
可悲的是,Ubuntu似乎无法找到docker-ce
软件包。有任何解决方案或至少跟踪发生的事情的想法吗?
这里为您提供一些细节…
$ uname --all; sudo grep docker /etc/apt/sources.list; sudo apt-get install docker-ce
Linux ubuntu 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable.
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package docker-ce
最佳思路
Ubuntu 20.04(Focal)
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
Ubuntu 19.10(Eoan)
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable"
Ubuntu 19.04(Disco)
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu disco stable"
Ubuntu 18.10(宇宙)
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic test"
Ubuntu 18.04(仿生)
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Ubuntu 17.10
docker-ce
软件包可在官方docker(Ubutu Artful)存储库上使用,使用以下命令进行安装:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu artful stable"
Ubuntu 16.04
您可以按照以下步骤在Ubuntu上安装docker-ce
:
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
运行以下命令:
sudo apt update
apt-cache search docker-ce
样本输出:
docker-ce - Docker: the open-source application container engine
安装docker-ce
:
对于Ubuntu 16.04,您需要运行sudo apt update
。对于Ubuntu 18.04及更高版本,add-apt-repository
将自动执行apt update
:
sudo apt install docker-ce
码头工人OS requirements
次佳思路
对于使用Ubuntu 17.10(熟练的)并且遇到此问题的任何人:
从https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
To install Docker CE, you need the 64-bit version of one of these Ubuntu versions:
Artful 17.10 (Docker CE 17.11 Edge only)
Zesty 17.04
Xenial 16.04
(LTS) Trusty 14.04 (LTS)
和:
To add the edge or test repository, add the word edge or test (or both) after the word stable in the commands
因此,如果您使用的是Ubuntu 17.10(精巧版),则需要添加以下内容:
$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable edge"
注意添加了”edge”字。如果您之前没有”edge”就已经运行过此命令。您可以在/etc/apt/sources.list
上编辑source.list
文件。之后,照常刷新并安装docker-ce
:
sudo apt-get update
sudo apt-get install docker-ce