“E:存储库没有发布文件。”尝试在 Debian 12 上更新时出错

“E:存储库没有发布文件。”尝试在 Debian 12 上更新时出错

当尝试这样做时sudo apt update,我面临着:

Hit:1 https://deb.debian.org/debian bookworm InRelease
Ign:2 https://deb.debian.org/debian bookworm-security InRelease
Hit:3 https://deb.debian.org/debian bookworm-updates InRelease
Err:4 https://deb.debian.org/debian bookworm-security Release
404  Not Found [IP: ***.**.**.*** ***]
Reading package lists... Done
E: The repository 'https://deb.debian.org/debian bookworm-security Release' does not have a Release file.
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

您的sources.list中有以下行:

deb http://deb.debian.org/debian bookworm-security main

/debian目录不包含安全更新,应替换为:

deb http://deb.debian.org/debian-security/ bookworm-security main

命令行:

sudo sed -e '/security/s/^/#/' -i /etc/apt/sources.list 
echo "deb http://deb.debian.org/debian-security/ bookworm-security main" |
sudo tee -a /etc/apt/sources.list

相关内容