Ubuntu无法安装docker源怎么解决

发布时间:2022-10-26 10:10:56 作者:iii
来源:亿速云 阅读:421

这篇文章主要介绍“Ubuntu无法安装docker源怎么解决”,在日常操作中,相信很多人在Ubuntu无法安装docker源怎么解决问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Ubuntu无法安装docker源怎么解决”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

按照各大网站以及个人习惯我会使用下面这种方法添加docker源:

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

然而使用上面这条命令给我带来了无尽的烦恼,甚至我都怀疑我是不是一个合格的linux工程师了,使用了这条命令提示以下错误:

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.

下面是apt源文件中的内容:

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

发现是没有任何错误的,但是你会发现在使用apt更新时会出现各种各样报错,最终还是没有你想要的docker-ce安装包,还是无法安装:

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:~#

解决方法:

在sources.list添加下面这一条就可以:

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

更新apt源:

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:~#

这样就好了,不报错了,再看看docker-ce这个安装包有没有:

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:~

到此,关于“Ubuntu无法安装docker源怎么解决”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!

推荐阅读:
  1. 解决Centos7安装docker源问题
  2. ubuntu安装nrpe无法安装问题

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

ubuntu docker

上一篇:Windows下如何安装VirtualBox及Ubuntu

下一篇:树莓派ubuntu安装docker的方法是什么

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》