分享Ubuntu19⽆法安装docker源问题
按照各⼤⽹站以及个⼈习惯我会使⽤下⾯这种⽅法添加Docker源:
root@ubuntu:~# sudo add-apt-repository "deb [arch=amd64] mirrors.ustc.edu/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
然⽽使⽤上⾯这条命令给我带来了⽆尽的烦恼,甚⾄我都怀疑我是不是⼀个合格的linux⼯程师了,使⽤了这条命令提⽰以下错误:
Ign:1 mirrors.ustc.edu/docker-ce/linux/ubuntu eoan InRelease
Err:2 mirrors.ustc.edu/docker-ce/linux/ubuntu eoan Release
404 Not Found [IP: 218.104.71.170 443]
Hit:3 cn.archive.ubuntu/ubuntu eoan InRelease
Hit:4 cn.archive.ubuntu/ubuntu eoan-updates InRelease
Hit:5 cn.archive.ubuntu/ubuntu eoan-backports InRelease
Hit:6 cn.archive.ubuntu/ubuntu eoan-security InRelease
Reading Done
E: The repository 'mirrors.ustc.edu/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] download.docker/linux/ubuntu eoan stable
# deb-src [arch=amd64] download.docker/linux/ubuntu eoan stable
deb [arch=amd64] download.docker/linux/ubuntu bionic stable
发现是没有任何错误的,但是你会发现在使⽤apt更新时会出现各种各样报错,最终还是没有你想要的docker-ce安装包,还是⽆法安装:
root@uduntu:~# apt-get update
Get:1 cn.archive.ubuntu/ubuntu eoan InRelease [255 kB]
Get:2 cn.archive.ubuntu/ubuntu eoan-updates InRelease [88.4 kB]
Hit:3 cn.archive.ubuntu/ubuntu eoan-backports InRelease
Get:4 cn.archive.ubuntu/ubuntu eoan-security InRelease [92.9 kB]
Ign:5 download.docker/linux/ubuntu eoan InRelease
Err:6 download.docker/linux/ubuntu eoan Release
404 Not Found [IP: 13.225.103.32 443]
Reading Done
E: The repository 'download.docker/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] download.docker/linux/ubuntu bionic stable
更新apt源:
root@uduntu:~# apt-get update
免费分享网站源码
Get:1 cn.archive.ubuntu/ubuntu eoan InRelease [255 kB]
Get:2 cn.archive.ubuntu/ubuntu eoan-updates InRelease [88.4 kB]
Hit:3 cn.archive.ubuntu/ubuntu eoan-backports InRelease
Get:4 cn.archive.ubuntu/ubuntu eoan-security InRelease [92.9 kB]
Get:5 download.docker/linux/ubuntu bionic InRelease [64.4 kB]
Get:6 download.docker/linux/ubuntu bionic/stable amd64 Packages [9,594 B] Fetched 511 kB in 11s (48.3 kB/s)
Reading Done
root@uduntu:~#
这样就好了,不报错了,再看看docker-ce这个安装包有没有:
root@uduntu:~# apt search docker-ce
< Done
Full 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:~
总结
以上所述是⼩编给⼤家介绍的分享Ubuntu19⽆法安装docker源问题,希望对⼤家有所帮助,如果⼤家有任何疑问请给我留⾔,⼩编会及时回复⼤家的。在此也⾮常感谢⼤家对⽹站的⽀持!
如果你觉得本⽂对你有帮助,欢迎转载,烦请注明出处,谢谢!

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。