Debian 运行 apt-get update 出错解决办法

新装了Debian 10 的系统,结果在更新的时候遇到了问题,记录。

执行:

apt-get update

错误:

0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
Need to get 1,245 kB of archives.
After this operation, 3,878 kB of additional disk space will be used.
Err:1 http://deb.debian.org/debian buster/main amd64 sudo amd64 1.8.27-1+deb10u2
  404  Not Found [IP: 146.75.30.132 80]
E: Failed to fetch http://deb.debian.org/debian/pool/main/s/sudo/sudo_1.8.27-1+deb10u2_amd64.deb  404  Not Found [IP: 146.75.30.132 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@usjk:~# apt-get update
Get:1 http://deb.debian.org/debian buster InRelease [122 kB]
Get:2 http://security.debian.org/debian-security buster/updates InRelease [34.8 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [56.6 kB]
Reading package lists... Done        
N: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Version' value from '10.4' to '10.13'
E: Repository 'http://deb.debian.org/debian buster InRelease' changed its 'Suite' value from 'stable' to 'oldoldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Repository 'http://security.debian.org/debian-security buster/updates InRelease' changed its 'Suite' value from 'stable' to 'oldoldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.
E: Repository 'http://deb.debian.org/debian buster-updates InRelease' changed its 'Suite' value from 'stable-updates' to 'oldoldstable-updates'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

您在尝试安装软件时遇到的问题是因为Debian Buster版本的软件仓库已经从 “stable” 更改为 “oldoldstable”。这通常在Debian发布了新的稳定版之后发生,旧的稳定版会被移至”oldstable”状态,而再旧的版本则变成”oldoldstable”。

这里的错误信息表明APT软件包管理器要求您确认这个变化,然后才能继续更新和安装软件包。

要解决这个问题,您需要执行以下步骤:

 apt-get update --allow-releaseinfo-change

然后更新软件包:

apt-get update
apt-get install sudo

如果有缺失的软件包,您可以添加 --fix-missing 选项:

sudo apt-get install sudo --fix-missing

By 行政