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

在Ubuntu 16.04上安装Docker Engine时遇到错误,提示仓库"https://download.docker.com/linux/ubuntu"没有Release文件。常规清理无效,需删除/etc/apt/sources.list.d/中的docker.list和docker.list.save文件。完成清理后,运行`sudo apt-get update`,问题得到解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

解决 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

没有报错,问题解决。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱写代码的大狼

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值