将旧版 16.04 LTS 升级到 18.04 LTS --- 'do-release-upgrade' 显示许多软件包未找到。我应该继续吗?

将旧版 16.04 LTS 升级到 18.04 LTS --- 'do-release-upgrade' 显示许多软件包未找到。我应该继续吗?

我是编程和运行软件/操作系统更新的新手,所以我尽量谨慎行事,尽管我的文件已备份以防万一。我已包含此升级过程的完整上下文,因此如果你想直接跳到问题随时滚动到末尾

我正在升级我们的旧服务器。使用以下命令删除旧的 PPA 引用:

sudo add-apt-repository --remove ppa:<username>/<ppaname>

..并更新我们的发布网址引用以old-releases使用:

sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list

..并安装管理器核心:

apt-get install update-manager-core

我运行了更新:

sudo apt-get update

..并且很高兴地看到大多数软件包都已更新,除了这 5 个软件包:

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://old-releases.ubuntu.com/ubuntu xenial-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://old-releases.ubuntu.com/ubuntu xenial-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://old-releases.ubuntu.com/ubuntu xenial-security 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://old-releases.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.123 80]
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.123 80]
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.123 80]
E: Failed to fetch http://old-releases.ubuntu.com/ubuntu/dists/xenial-security/main/binary-amd64/Packages  404  Not Found [IP: 91.189.91.123 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.

此时不确定这是否会对升级造成影响(很难在网上找到明确的答案)因此我继续运行升级:

sudo apt-get upgrade -y

一切似乎都很顺利,但实际上什么也没发生:

The following packages have been kept back:
  certbot python-acme python-certbot-apache python-parsedatetime python3-requests python3-urllib3
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.

..所以我进入下一步并运行:

sudo apt-get dist-upgrade

运行正常,没有出现任何错误,因此我进入下一步并运行:

sudo do-release-upgrade

..就在那时,我收到了大约一百个这样的 404 错误(全部来自同一个 IP 地址):

Err http://old-releases.ubuntu.com/ubuntu xenial/main all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/main Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/restricted amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/restricted i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/restricted all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/restricted Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/universe amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/universe i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/universe all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/universe Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/multiverse amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/multiverse i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/multiverse all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial/multiverse Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/main i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/main all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/main Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/restricted all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/restricted Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/universe i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/universe all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/universe Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/multiverse all Packages
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-updates/multiverse Translation-en
  404  Not Found [IP: 185.125.190.37 80]
Err http://old-releases.ubuntu.com/ubuntu xenial-backports/main amd64 Packages
  404  Not Found [IP: 185.125.190.37 80]

还需要研究这些快照:

No snaps are installed yet. Try 'snap install hello-world'.

Checking for installed snaps

Calculating snap size requirements
No candidate ver:  liblockfile1
No candidate ver:  python-pbr
No candidate ver:  sendmail-base
No candidate ver:  sendmail-bin
No candidate ver:  sendmail-cf
No candidate ver:  ssmtp

Updating repository information

Third party sources disabled

Some third party entries in your sources.list were disabled. You can
re-enable them after the upgrade with the 'software-properties' tool
or your package manager.

To continue please press [ENTER]
^C
=== Command terminated with signal 2 (Wed Aug  3 13:41:27 2022) ===

我 ping 185.125.190.37 没问题,所以这些软件包似乎不存在于这个 IP 地址上... 我害怕在没有确保大多数软件包没有被检索的情况下运行升级。这引出了我的问题——

问题: 缺少这么多软件包还能运行吗do-release-upgrade?如果不行,我该如何获取这些软件包?Ubuntu 16.04 是不是太晚了?

非常感谢你的帮助!

答案1

正如这里所述,16.04 ESM 仍然支持的因此你不需要使用 old-releases.ubuntu.com标准支持已经结束,因此现在升级变得复杂,这可能取决于你在世界的哪个地方。我会提供一些想法

  • 为了在您的位置获得良好的 CA 证书,您可能会遇到 EOL 证书,除非您已应用 ESM 修复并从而启用了 ESM 并使用仅通过 ESM 提供的软件包进行完全升级。

  • 作为标准支持已经结束,许多 PPA 和第三方镜像可能已经放弃了对该版本的支持,所以如果你正在使用其中一个,你可能会有一些软件包给你带来问题,而你只有在你问题。但是,如果您只使用 Ubuntu 存储库软件,我预计这里不会出现问题。

  • 将源返回到主存档并尝试一下do-release-upgrade。几周前我这样做是为了在赛尼尔我发现,经过几分钟(5-8 分钟)的修复问题和升级软件包后,系统do-release-upgrade开始正常运行并下载仿生的软件包...就我而言,我中止了升级并将我的盒子退回到赛尼尔当我需要时,我会通过重新安装来升级它) 但它已经达到了我很高兴它能正常工作的程度并且我可以留下我的评论。

对于你的情况,我会将 old-releases.ubuntu.com 恢复为 archive.ubuntu.com 并确保你拥有所有软件包,然后重试。如前所述,你所遇到的问题可能取决于你所在的位置(证书;你可能需要申请 ESM 才能获得升级证书,或者像我一样幸运,不需要)或与第三方软件包有关的问题(对我来说没问题;我没有)。

如果你想避免这种情况,只需在系统结束前维护并升级即可标准支持Ubuntu 16.04 LTS 的名称表明它是 2016 年 4 月发布的,它附带 5 年的标准支持;因此将 5(年份)加到 16(2016 年)得出 2021 年 4 月标准支持终止(EOSS)或当你需要完成发布升级在可能需要额外工作之前完成。

答案2

看起来仍在 ESM 中(尚未 EOL)的版本位于https://us.archive.ubuntu.com(或您自己的两个字母的国家代码),而不是https://old-releases.ubuntu.com。要确认这一点,您可以尝试通过 url + 访问它们/ubuntu/dists,看看您的版本是否位于那里。在这种情况下,我检查了一下,目前 xenial 根本不在旧版本中。您可以尝试切换 sources.list 以指向该站点,看看更新是否通过。

答案3

我认为从一个不再受支持的版本“升级”到另一个 EOL 版本也是一个坏主意。我建议您至少升级(可能是全新安装?)到 22.04 或 20.04。

相关内容