项目场景:
ubuntu22.04.3安装docker报错:Package ‘docker-ce’ has no installation candidate
问题描述
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package docker-ce is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: 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
解决方案:
#配置阿里云的gpg
#配置阿里云的docker镜像仓库
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
#执行安装命令
sudo apt-get install docker-ce docker-ce-cli containerd.io
#######如果上面方法还不行######
#再执行以下命令:
sudo apt-get upgrade
#然后再执行安装命令
sudo apt-get install docker-ce docker-ce-cli containerd.io