经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » 程序设计 » Docker » 查看文章
分享Ubuntu19无法安装docker源问题
来源:jb51  时间:2019/11/1 10:06:14  对本文有异议

按照各大网站以及个人习惯我会使用下面这种方法添加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. Ign:1 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan InRelease
  2.  
  3. Err:2 https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan Release
  4. 404 Not Found [IP: 218.104.71.170 443]
  5. Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan InRelease
  6. Hit:4 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease
  7. Hit:5 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
  8. Hit:6 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease
  9. Reading package lists... Done
  10. E: The repository 'https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu eoan Release' does not have a Release file.
  11. N: Updating from such a repository can't be done securely, and is therefore disabled by default.
  12. N: See apt-secure(8) manpage for repository creation and user configuration details.

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

  1. deb [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
  2. # deb-src [arch=amd64] https://download.docker.com/linux/ubuntu eoan stable
  3. deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable

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

  1. root@uduntu:~# apt-get update
  2. Get:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]
  3. Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]
  4. Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
  5. Get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]
  6. Ign:5 https://download.docker.com/linux/ubuntu eoan InRelease
  7. Err:6 https://download.docker.com/linux/ubuntu eoan Release
  8. 404 Not Found [IP: 13.225.103.32 443]
  9. Reading package lists... Done
  10. E: The repository 'https://download.docker.com/linux/ubuntu eoan Release' does not have a Release file.
  11. N: Updating from such a repository can't be done securely, and is therefore disabled by default.
  12. N: See apt-secure(8) manpage for repository creation and user configuration details.
  13. root@uduntu:~# apt search docker-ce
  14. root@uduntu:~#
  15.  

遇到这种问题我也觉得很头疼,在网上找了很多解决方法都是不行,有人都说是网络问题无法使用外网的源码库,我看到这个文章我都懵了,我还试过安装网易、阿里以及科大的源都不能更好的解决问题,其实这个很简单看一下阿里、科大和网易的他们的源码库是怎么往配置文件里面写的,然后比葫芦画瓢画一个不就完了

解决方法:

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

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

更新apt源:

  1. root@uduntu:~# apt-get update
  2. Get:1 http://cn.archive.ubuntu.com/ubuntu eoan InRelease [255 kB]
  3. Get:2 http://cn.archive.ubuntu.com/ubuntu eoan-updates InRelease [88.4 kB]
  4. Hit:3 http://cn.archive.ubuntu.com/ubuntu eoan-backports InRelease
  5. Get:4 http://cn.archive.ubuntu.com/ubuntu eoan-security InRelease [92.9 kB]
  6. Get:5 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
  7. Get:6 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages [9,594 B] Fetched 511 kB in 11s (48.3 kB/s)
  8. Reading package lists... Done
  9. root@uduntu:~#
  10.  

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

  1. root@uduntu:~# apt search docker-ce
  2. Sorting... Done
  3. Full Text Search... Done
  4. docker-ce/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed]
  5. Docker: the open-source application container engine
  6.  
  7. docker-ce-cli/bionic,now 5:19.03.4~3-0~ubuntu-bionic amd64 [installed,automatic]
  8. Docker CLI: the open-source application container engine
  9.  
  10. root@uduntu:~

总结

以上所述是小编给大家介绍的分享Ubuntu19无法安装docker源问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对w3xue网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号