将 Debian 9 更新到较新版本时遇到问题

将 Debian 9 更新到较新版本时遇到问题

我有一个匿名根服务器,主要运行 Web 服务(带有 php5 的 Apache)、邮件和 VPN。是时候将其更新为稳定且受支持的系统版本了。

我跟着Debian 升级文档,但遇到了一些小(?)问题,例如虽然我的系统仍然使用“eth0”,但没有/etc/udev/rules.d/70-persistent-net.rules文件,所以我什至不知道如何继续。

暂时忽略这一点,我无法开始apt update工作。经过一番阅读后,我想出了这个/etc/apt/sources.list

deb [trusted=yes] http://archive.debian.org/debian stretch main contrib non-free
deb [trusted=yes] http://security.debian.org/debian-security stretch/updates contrib main non-free

还有一个文件/etc/apt/sources.list.d/backports.list,我将其更改为:

deb [trusted=yes] http://archive.debian.org/debian stretch-backports main

apt update然后列出了几十Ign: …行和这些:

Err:3 http://security.debian.org/debian-security stretch/updates/contrib amd64 Packages
  404  Not Found [IP: 199.232.190.132 80]

结尾为:

Reading package lists... Done                     
E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/contrib/binary-amd64/Packages  404  Not Found [IP: 199.232.190.132 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

更新

修复“debian-security”源链接后,我尝试使用以下列表更新到buster:

deb http://ftp.de.debian.org/debian buster main contrib non-free
deb http://ftp.de.debian.org/debian buster-updates main contrib non-free
#deb http://ftp.de.debian.org/debian buster-backports main contrib non-free
deb http://security.debian.org/debian-security/ buster/updates main contrib non-free

(向后移植链接导致另一个“无发布文件”错误,因此我将其省略。)

这导致:

# apt update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://ftp.de.debian.org/debian buster InRelease                      
Hit:3 http://ftp.de.debian.org/debian buster-updates InRelease              
The AppStream system cache was updated, but some errors were detected, which might lead to missing metadata. Refer to the verbose log for more information.
Reading package lists... Done
E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code

答案1

如中所示Debian Stretch 的安全存储库不再工作,您需要将指向安全更新存储库的行替换为

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

这取代了

deb [trusted=yes] http://security.debian.org/debian-security stretch/updates contrib main non-free

你目前有。

也可以看看从 maven:3.5.2-jdk-8 构建 dockerfile 时,apt-get update 无法获取 debian amd64 软件包有关 Debian 9 存储库的更一般上下文。

您的 Buster 更新正确检索了所需的信息apt。该错误仅与AppStream有关,不需要apt;没有它你也可以升级。

相关内容