ubuntu docker-ce最新版安装,docker官方源安装不上,W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubun

前端之家收集整理的这篇文章主要介绍了ubuntu docker-ce最新版安装,docker官方源安装不上,W: Failed to fetch https://apt.dockerproject.org/repo/dists/ubun前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

官方文档有毒 源下不下来 所以这里使用阿里源下载

  1. -------------
  2. Docker 官方apt仓库(不能用)
  3.  
  4. # 添加 Docker 官方的 GPG 密钥(为了确认所下载软件包的合法性,需要添加软件源的 GPG 密钥)
  5. $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  6.  
  7. # 设置稳定版本的apt仓库地址
  8. $ sudo add-apt-repository \
  9. "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
  10. $(lsb_release -cs) \
  11. stable"
  12.  
  13.  
  14. 如果你已经添加过官网的源 请在/etc/apt/sources.list 最后那几行删掉(有一个是那刚才添加的国外deb 不然你每次apt update 都会爆一个蛋疼的错Failed to fetch https://apt.dockerproject.org/repo/dists/ubun),然后执行下面的阿里云安装源
  15.  
  16. ------------
  17. 阿里云 apt仓库
  18.  
  19. $ curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
  20.  
  21. $ sudo add-apt-repository \
  22. "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu \
  23. $(lsb_release -cs) \
  24. stable"

猜你在找的Ubuntu相关文章