Debian 镜像提示 does not have a Release file. 404错误

以下内容均在root权限下执行

apt-get update

一、执行更新语句时,提示如下错误:does not have a Release file


W: The repository 'http://mirrors.163.com/debian stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian stretch-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian stretch-backports Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://mirrors.163.com/debian-security stretch/updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch/main/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch-updates/contrib/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian/dists/stretch-backports/contrib/source/Sources  404  Not Found
E: Failed to fetch http://mirrors.163.com/debian-security/dists/stretch/updates/contrib/source/Sources  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.

1. 原因:

404的本质是这个镜像地址所在的目录中,找不到相应的资源。因为从2023-04月开始 debian stretch 地址发生了变更。

2. 需更新文件

nano /etc/apt/sources.list

使用如下源:

deb http://archive.debian.org/debian/ stretch main contrib non-free
deb-src http://archive.debian.org/debian/ stretch main contrib non-free
deb http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://archive.debian.org/debian-security/ stretch/updates main contrib non-free
deb http://archive.debian.org/debian/ stretch-backports main contrib non-free

3. 再执行:

apt-get update

发现即可成功更新。

不过别高兴的太早。。。

二、更新过程中 还可能会遇到NO_PUBKEY的问题:

W: GPG error: http://archive.debian.org/debian stretch-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY 0E98404D386FA1D9
E: The repository 'http://archive.debian.org/debian stretch-backports InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

1. 需要将出现的NO_PUBKEY 依次添加进到系统

我这里有2个,执行2遍

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9

最终执行成功截图如下:

当然这时候,高兴还是可能早了点~

三、如果和我一样很不幸,在处理NO_PUBKEY的时候又遇到了这个问题:No dirmngr

keyserver receive failed: No dirmngr

 需要先安装dirmngr,安装完成后,更新包,再返回第二步,处理NO_PUBKEY的问题

# 检查包是否正常
apt-cache search -n dirmngr
# 安装dirmngr
apt-get install dirmngr
# 更新包
apt-get update

长路漫漫,诸君需努力啊~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值