从 Ubuntu 21.10 升级 Raspberry Pi

从 Ubuntu 21.10 升级 Raspberry Pi

我有一台运行 Ubuntu 21.10 的 Raspberry Pi,我最近得知它已经停产了。不用担心,我只需升级到下一个版本(幸运的是,它是一个 LTS 版本)...我是这样认为的……

我想升级到 Ubuntu 22.04 LTS,但所有升级工具似乎都不起作用,这让我很困惑。

就上下文而言,我习惯使用 Debian,您只需编辑apt.sources.list和升级软件包即可。据我发现,对于 Ubuntu,首选的升级方法似乎是该工具。但是,该工具在我的系统上没有任何作用(而且我找不到任何我缺少的do-release-upgrade命令行开关):--actually-do-upgrade

anthony@planetsrv:~$ sudo do-release-upgrade
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Please install all available updates for your release before upgrading.

它只是告诉我我已经生命终点了——我知道,这就是我努力升级的原因!:) 这关联只是给出了发布时间表;我没有看到任何关于从 EOL 版本升级的说明或提示。

运行时apt update,我只收到 404 错误:

anthony@planetsrv:~$ sudo apt update
Ign:1 http://ports.ubuntu.com/ubuntu-ports impish InRelease
Ign:2 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease
Ign:3 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease
Ign:4 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease
Err:5 http://ports.ubuntu.com/ubuntu-ports impish Release
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Err:6 http://ports.ubuntu.com/ubuntu-ports impish-updates Release
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Err:7 http://ports.ubuntu.com/ubuntu-ports impish-backports Release
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Err:8 http://ports.ubuntu.com/ubuntu-ports impish-security Release
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Reading package lists... Done
E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish Release' no longer has 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.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-updates Release' no longer has 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.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-backports Release' no longer has 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.
E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-security Release' no longer has 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.

相同apt upgrade

anthony@planetsrv:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following packages will be upgraded:
  apt apt-utils cloud-init gtk-update-icon-cache keyutils libapt-pkg6.0 libgtk-3-0 libgtk-3-bin libgtk-3-common libkeyutils1 libnss-systemd libpam-systemd librados2 librbd1 libsystemd0 libudev1
  python3-distupgrade snapd systemd systemd-sysv systemd-timesyncd ubuntu-advantage-tools ubuntu-release-upgrader-core udev
24 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 41.2 MB of archives.
After this operation, 122 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 libnss-systemd arm64 248.3-1ubuntu8.6
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Err:2 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 libsystemd0 arm64 248.3-1ubuntu8.6
  404  Not Found [IP: 2620:2d:4000:1::19 80]
Err:3 http://ports.ubuntu.com/ubuntu-ports impish-updates/main arm64 systemd-timesyncd arm64 248.3-1ubuntu8.6

...snipping repetitive similar lines, you get the idea :)...

E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/s/systemd/libnss-systemd_248.3-1ubuntu8.6_arm64.deb  404  Not Found [IP: 2620:2d:4000:1::19 80]
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/s/systemd/libsystemd0_248.3-1ubuntu8.6_arm64.deb  404  Not Found [IP: 2620:2d:4000:1::19 80]
E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/s/systemd/systemd-timesyncd_248.3-1ubuntu8.6_arm64.deb  404  Not Found [IP: 2620:2d:4000:1::19 80]

...snipping some more...

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

我碰到这个问题这表明软件包已移至old-releases.ubuntu.comus.archive.ubuntu.com,但这两个似乎都不适合我。我还遇到了这个问题解决办法似乎是彻底清除并重新安装,但我宁愿避免这种情况。

这是我当前的sources.list(删除了评论):

deb http://ports.ubuntu.com/ubuntu-ports impish main restricted
deb http://ports.ubuntu.com/ubuntu-ports impish-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports impish universe
deb http://ports.ubuntu.com/ubuntu-ports impish-updates universe
deb http://ports.ubuntu.com/ubuntu-ports impish multiverse
deb http://ports.ubuntu.com/ubuntu-ports impish-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports impish-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports impish-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports impish-security universe
deb http://ports.ubuntu.com/ubuntu-ports impish-security multiverse

我应该如何更新我的系统?我是否sources.list可以像在 Debian 中一样,只更新版本名称,然后通过这种方式进行大升级?或者有什么方法可以让原始工具 ( do-release-upgrade) 正常工作?

答案1

我弄清楚了服务器所遇到的问题old-releases

因为我使用的是 Raspberry Pi,并且是 ARM 架构,所以我的sources.list 看起来像deb http://ports.ubuntu.com/ubuntu-ports/ impish main restricted。具体来说,请注意 URL 以 ubuntu- 结尾端口

old-releases服务器上,他们显然没有为端口和主要架构使用单独的目录。通过将我的sources.list条目更新到http://old-releases.ubuntu.com/ubuntu/,我能够获得最新的更新到 21.10。

在我弄清楚了 sources.list 之后,我就能apt update和了apt upgrade,此时do-release-upgrade我就能运行并将我升级到 22.04。

注意:作为我的系统的一部分apt upgrade,安装了一个新的内核。 此时我应该重新启动,但是没有。do-release-upgrade之后就立即运行了。版本升级尝试卸载旧内核版本(当前正在运行的版本,被替换了apt update),但出现了一个大警告“您即将卸载当前正在运行的内核,确定吗??”。就我而言,我说“不”,只是apt autoremove在版本升级完成后重新启动。 我怀疑如果我之后重新启动apt upgrade,我就不会看到这个问题。

注2:升级工具似乎对您的架构很智能,并且-ports在自动更新我的 sources.list 时为我重新添加了。

答案2

让你的 Ubuntu 保持更新的最佳方式应该是(作为一个命令,以便在最后一个命令之后自动执行一个命令)

sudo apt update && sudo apt full-upgrade && sudo apt autoremove

希望这可以帮助

否则

sudo apt 列表 --upgradable && sudo apt 升级

应该也可以。不确定这是否正是你想要的,我的 ubuntu cmd 有点生疏 ^^

相关内容