问题描述
运行 sudo apt-get update 的时候,出现如下提示:
E: The repository 'http://mirrors.163.com/debian stretch Release' does no longer 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.
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.
排查
google 了下,发现了一些帖子: Debian: The repository does not have a Release file。
里面有提到 stretch(debian 9 的别名)的仓库被移除主镜像了,需要切换到 archive 中。
In late April 2023, the Stretch repositories were removed from the main mirrors, so you’ll need to switch to
archive.debian.org; see apt-get update failed to fetch debian amd64 packages while building dockerfile from maven:3.5.2-jdk-8 and Security repo for Debian stretch not working anymore for details.
查看网易镜像
查看网易镜像主页 欢迎访问网易开源镜像站,发现如下仓库:
进入 debian-archive 子页之后,发现里面完整包含了 debian、debian-security、debian-backports 等等项目,其网页为:https://mirrors.163.com/debian-archive/
因此网易的软件源理应改为:
deb http://mirrors.163.com/debian-archive/debian/ stretch main non-free contrib
deb http://mirrors.163.com/debian-archive/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.163.com/debian-archive/debian/ stretch main non-free contrib
deb-src http://mirrors.163.com/debian-archive/debian/ stretch-backports main non-free contrib
deb http://mirrors.163.com/debian-archive/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.163.com/debian-archive/debian-security/ stretch/updates main non-free contrib
问题解决
按照如上操作之后,重新运行 sudo apt-get update,问题解决:
sudo apt-get update
Ign:1 http://mirrors.163.com/debian-archive/debian stretch InRelease
Get:2 http://mirrors.163.com/debian-archive/debian stretch-backports InRelease [78.5 kB]
Hit:3 https://deb.nodesource.com/node_14.x stretch InRelease
Get:4 http://mirrors.163.com/debian-archive/debian-security stretch/updates InRelease [59.1 kB]
Get:5 http://mirrors.163.com/debian-archive/debian stretch Release [118 kB]
Get:6 http://mirrors.163.com/debian-archive/debian stretch-backports/non-free Sources [8,412 B]
Get:7 http://mirrors.163.com/debian-archive/debian stretch-backports/main Sources [558 kB]
Get:8 http://mirrors.163.com/debian-archive/debian stretch-backports/contrib Sources [6,528 B]
Get:9 http://mirrors.163.com/debian-archive/debian stretch-backports/main amd64 Packages [612 kB]
Get:10 http://mirrors.163.com/debian-archive/debian stretch-backports/main Translation-en [467 kB]
Get:11 http://mirrors.163.com/debian-archive/debian stretch-backports/non-free amd64 Packages [33.2 kB]
Get:12 http://mirrors.163.com/debian-archive/debian stretch-backports/non-free Translation-en [38.5 kB]
Get:13 http://mirrors.163.com/debian-archive/debian stretch-backports/contrib amd64 Packages [10.9 kB]
Get:14 http://mirrors.163.com/debian-archive/debian stretch-backports/contrib Translation-en [7,237 B]
Get:15 http://mirrors.163.com/debian-archive/debian-security stretch/updates/contrib Sources [1,384 B]
Get:16 http://mirrors.163.com/debian-archive/debian stretch Release.gpg [3,177 B]
Get:17 http://mirrors.163.com/debian-archive/debian-security stretch/updates/non-free Sources [3,568 B]
Get:18 http://mirrors.163.com/debian-archive/debian-security stretch/updates/main Sources [413 kB]
Get:19 http://mirrors.163.com/debian-archive/debian-security stretch/updates/main amd64 Packages [782 kB]
Get:20 http://mirrors.163.com/debian-archive/debian-security stretch/updates/main Translation-en [368 kB]
Get:21 http://mirrors.163.com/debian-archive/debian-security stretch/updates/non-free amd64 Packages [14.1 kB]
Get:22 http://mirrors.163.com/debian-archive/debian-security stretch/updates/non-free Translation-en [21.3 kB]
Get:23 http://mirrors.163.com/debian-archive/debian-security stretch/updates/contrib amd64 Packages [1,760 B]
Get:24 http://mirrors.163.com/debian-archive/debian-security stretch/updates/contrib Translation-en [1,759 B]
Get:25 http://mirrors.163.com/debian-archive/debian stretch/non-free Sources [79.1 kB]
Get:26 http://mirrors.163.com/debian-archive/debian stretch/contrib Sources [44.5 kB]
Get:27 http://mirrors.163.com/debian-archive/debian stretch/main Sources [6,736 kB]
Get:28 http://mirrors.163.com/debian-archive/debian stretch/main amd64 Packages [7,080 kB]
Get:29 http://mirrors.163.com/debian-archive/debian stretch/main Translation-en [5,377 kB]
Get:30 http://mirrors.163.com/debian-archive/debian stretch/non-free amd64 Packages [78.3 kB]
Get:31 http://mirrors.163.com/debian-archive/debian stretch/non-free Translation-en [80.2 kB]
Get:32 http://mirrors.163.com/debian-archive/debian stretch/contrib amd64 Packages [50.7 kB]
Get:33 http://mirrors.163.com/debian-archive/debian stretch/contrib Translation-en [45.8 kB]
Fetched 23.2 MB in 1min 38s (236 kB/s)
Reading package lists... Done