小知识:分享Ubuntu19无法安装docker源问题

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

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

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

?
1
2
3
4
5
6
7
8
9
10
11
12
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 cant be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

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

?
1
2
3
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安装包,还是无法安装:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 cant 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添加下面这一条就可以:

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

更新apt源:

?
1
2
3
4
5
6
7
8
9
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这个安装包有没有:

?
1
2
3
4
5
6
7
8
9
10
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

19无法安装docker源问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对服务器之家网站的支持!

如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

原文链接:https://www.cnblogs.com/kuiyajia/archive/2019/10/31/11772589.html

声明: 猿站网有关资源均来自网络搜集与网友提供,任何涉及商业盈利目的的均不得使用,否则产生的一切后果将由您自己承担! 本平台资源仅供个人学习交流、测试使用 所有内容请在下载后24小时内删除,制止非法恶意传播,不对任何下载或转载者造成的危害负任何法律责任!也请大家支持、购置正版! 。本站一律禁止以任何方式发布或转载任何违法的相关信息访客发现请向站长举报,会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。本网站的资源部分来源于网络,如有侵权烦请发送邮件至:2697268773@qq.com进行处理。
建站知识

小知识:详解Dockerfile创建自定义Docker镜像以及CMD与ENTRYPOINT指令的比较

2023-4-1 11:24:37

建站知识

小知识:docker安装并运行rabbitmq的实例代码

2023-4-1 11:39:02

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索