以下内容均在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
长路漫漫,诸君需努力啊~