仓库 “https://download.docker.com/linux ubuntu Release” 没有 Release 文件。N: 无法安全地用该源进行更新,所以默认禁用该源

解决 E: 仓库 “https://download.docker.com/linux ubuntu Release” 没有 Release 文件。N: 无法安全地用该源进行更新,所以默认禁用该源。

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

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

一、先用常规解决办法

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

没有报错,问题解决。

猜你喜欢

转载自blog.csdn.net/zhangmingfie/article/details/126893206