Package ‘docker-ce’ has no installation candidate

Table of Contents

错误:

记录一个错误,在Ubuntu上按照官方文档按钻过docker完成后,发现检查docker版本时报错:

: Package 'docker-ce' has no installation candidate 
E: Unable to locate package docker-ce-cli E: Unable to locate package containerd.io 
E: Couldn't find any package by glob 'containerd.io' 
E: Couldn't find any package by regex 'containerd.io' 
E: Unable to locate package docker-buildx-plugin 
E: Unable to locate package docker-compose-plugin

解决方案:

可能是由于Docker的存储库没有被添加到你的系统中

1、更新你的包列表

sudo apt-get update

2、安装一些必要的包,这些包允许apt通过HTTPS使用存储库

sudo apt-get install apt-transport-https ca-certificates curl software-properties-common

3、添加Docker的官方GPG密钥

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

4、添加Docker存储库

sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

5、再次更新你的包列表

sudo apt-get update

6、再次安装Docker

sudo apt-get install docker-ce docker-ce-cli containerd.io

此时问题解决。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注