E: 无法下载 https://download.docker.com/linux/ubuntu/dists/Xenial/stable/binary-amd64/Packages 404 Not

E: 无法下载 https://download.docker.com/linux/ubuntu/dists/Xenial/stable/binary-amd64/Packages 404 Not Found

在ubuntu16.04上安装Docker Engine时出错

在ubuntu16.04上安装Docker Engine时出错,在官网https://docs.docker.com/engine/install/ubuntu/
链接: https://docs.docker.com/engine/install/ubuntu/.
使用以下命令后

 echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

接着往下面运行

sudo apt-get update

时出现以下报错

E: 无法下载 https://download.docker.com/linux/ubuntu/dists/Xenial/stable/binary-amd64/Packages 404 Not Found

部分终端中的信息如下:

命中:1 http://packages.osrfoundation.org/gazebo/ubuntu xenial InRelease
命中:2 https://mirrors.ustc.edu.cn/ubuntu xenial InRelease                     
命中:3 https://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease     
命中:4 https://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease   
命中:5 https://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease    
命中:6 http://packages.ros.org/ros/ubuntu xenial InRelease            
命中:7 http://ppa.launchpad.net/thopiekar/mt7601/ubuntu xenial InRelease
命中:8 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu xenial InRelease
忽略:9 https://download.docker.com/linux/ubuntu Xenial InRelease               
命中:10 http://ppa.launchpad.net/zarquon42/meshlab/ubuntu xenial InRelease
忽略:11 https://download.docker.com/linux/ubuntu Xenial Release
忽略:12 https://download.docker.com/linux/ubuntu Xenial/stable amd64 Packages
忽略:13 https://download.docker.com/linux/ubuntu Xenial/stable all Packages
忽略:14 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh_CN
忽略:15 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh
忽略:16 https://download.docker.com/linux/ubuntu Xenial/stable Translation-en
忽略:17 https://download.docker.com/linux/ubuntu Xenial/stable amd64 DEP-11 Metadata
忽略:18 https://download.docker.com/linux/ubuntu Xenial/stable DEP-11 64x64 Icons
忽略:12 https://download.docker.com/linux/ubuntu Xenial/stable amd64 Packages
忽略:13 https://download.docker.com/linux/ubuntu Xenial/stable all Packages
忽略:14 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh_CN
忽略:15 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh
忽略:16 https://download.docker.com/linux/ubuntu Xenial/stable Translation-en
忽略:17 https://download.docker.com/linux/ubuntu Xenial/stable amd64 DEP-11 Metadata
忽略:18 https://download.docker.com/linux/ubuntu Xenial/stable DEP-11 64x64 Icons
忽略:12 https://download.docker.com/linux/ubuntu Xenial/stable amd64 Packages
忽略:13 https://download.docker.com/linux/ubuntu Xenial/stable all Packages
忽略:14 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh_CN
忽略:15 https://download.docker.com/linux/ubuntu Xenial/stable Translation-zh
忽略:16 https://download.docker.com/linux/ubuntu Xenial/stable Translation-en
忽略:17 https://download.docker.com/linux/ubuntu Xenial/stable amd64 DEP-11 Metadata
忽略:18 https://download.docker.com/linux/ubuntu Xenial/stable DEP-11 64x64 Icons
忽略:12 https://download.docker.com/linux/ubuntu Xenial/stable amd64 Packages

从中可以看出是由于https://download.docker.com此网站添加到了软件源列表中,访问它时,从而引起的报错,那么再把它从软件源列表中删除掉,找一篇博客,照着重新从头再安装一次Docker Engine就好了。

一、先用常规解决办法

1、在“设置”里的软件与更新中将https://download.docker.com此网站前面的对勾取消掉或者直接将此网站“删除”,发现仍然报同样的错误,说明没有彻底清理干净。

2、参考其他博客,采用编辑修改source.list的方法,发现由于上一步的操作,source.list中已经没有此网站,也就无从改起。

3、参考其他博客,将目录下var/lib/apt/lists下的以download.docker开头的两个文件删除,提升权限并使用强制删除命令删除

sudo su
rm -f download.docker.com_linux_ubuntu_dists_xenial_stable_binary-amd64_Packages 
rm -f download.docker.com_linux_ubuntu_dists_xenial_InRelease

接着往下面运行

sudo apt-get update

仍然报错…

说明还有没有删掉的。

二、漏网之鱼(仍没有删掉的两个文件)

etc/apt/sources.list.d中存在两个文件 docker.list以及docker.list.save,仿照前面的操作将其强制删除即可。

sudo su
rm -f docker.list
rm -f docker.list.save

三、结果

做完以上操作之后,再次运行

sudo apt-get update

没有报错,问题解决。

yyd@yyd-linux:/etc/apt/sources.list.d$ sudo apt-get update
命中:1 https://mirrors.ustc.edu.cn/ubuntu xenial InRelease
命中:2 https://mirrors.ustc.edu.cn/ubuntu xenial-updates InRelease             
命中:3 https://mirrors.ustc.edu.cn/ubuntu xenial-backports InRelease           
命中:4 https://mirrors.ustc.edu.cn/ubuntu xenial-security InRelease            
命中:5 http://ppa.launchpad.net/thopiekar/mt7601/ubuntu xenial InRelease       
命中:6 http://packages.ros.org/ros/ubuntu xenial InRelease                     
命中:7 http://packages.osrfoundation.org/gazebo/ubuntu xenial InRelease        
命中:8 http://ppa.launchpad.net/ubuntu-desktop/ubuntu-make/ubuntu xenial InRelease
命中:9 http://ppa.launchpad.net/zarquon42/meshlab/ubuntu xenial InRelease      
正在读取软件包列表... 完成  
  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值