雷达智富

首页 > 内容 > 程序笔记 > 正文

程序笔记

如何从 Ubuntu 22.04 升级到 Ubuntu 23.10

2024-07-26 47

Ubuntu 23.10 是 Ubuntu 24.04 LTS(长期支持版本)之前的最后一个临时版本。在这个版本中,Ubuntu 操作系统背后的团队旨在提供与 Ubuntu 24.04 版本中预期相同的主要更改和功能。这让您有机会试用它们,并与开发团队分享任何反馈,以便在 Ubuntu 24.04 LTS 发布之前进行合并和额外改进。

如果您有兴趣在 23.10 上测试所有预期的 Ubuntu 24.04 LTS 功能,那么本文适合您。但请注意,23.10 不是 LTS 版本。避免在生产系统中执行此升级,但也许在允许破坏事物的实验室环境中执行此升级。

登录您的 22.04 系统并执行任何可用的小升级。

sudo apt update && sudo apt dist-upgrade -y

将新更新应用到系统后,如果需要,请重新启动。

[ -f /var/run/reboot-required ] && sudo reboot -f

安装 tmux,以便我们可以在其会话中而不是 SSH 中执行升级。

sudo apt install tmux

do-release-upgrade 实用程序用于从命令行界面将操作系统升级到最新版本。

$ sudo do-release-upgrade
Checking for a new Ubuntu release
There is no development version of an LTS available.
To upgrade to the latest non-LTS development release
set Prompt=normal in /etc/update-manager/release-upgrades.

从输出中我们可以确认没有可以升级到的 LTS 版本。 24.04 发布后,它将出现在升级路径列表中。

默认提示是lts,如下所示。

root@jammy:~# cat /etc/update-manager/release-upgrades
# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting and upgrade behavior, valid options:
#
#  never  - Never check for, or allow upgrading to, a new release.
#  normal - Check to see if a new release is available.  If more than one new
#           release is found, the release upgrader will attempt to upgrade to
#           the supported release that immediately succeeds the
#           currently-running release.
#  lts    - Check to see if a new LTS release is available.  The upgrader
#           will attempt to upgrade to the first LTS release available after
#           the currently-running one.  Note that if this option is used and
#           the currently-running release is not itself an LTS release the
#           upgrader will assume prompt was meant to be normal.
Prompt=lts

要升级到最新的非 LTS 开发版本,我们需要在 /etc/update-manager/release-upgrades 中设置 Prompt=正常

sudo sed -i 's/^Prompt=.*/Prompt=normal/g' /etc/update-manager/release-upgrades

启动新的 tmux 会话以开始升级过程。

tmux

现在通过执行命令do-release-upgrade来初始化系统升级。

$ sudo do-release-upgrade
Checking for a new Ubuntu release

= Welcome to Ubuntu 23.10 'Mantic Minotaur' =

The Ubuntu team is proud to announce Ubuntu 23.10 'Mantic Minotaur'.

To see what's new in this release, visit:
  https://wiki.ubuntu.com/ManticMinotaur/ReleaseNotes

Ubuntu is a Linux distribution for your desktop or server, with a fast
and easy install, regular releases, a tight selection of excellent
applications installed by default, and almost any other software you
can imagine available through the network.

We hope you enjoy Ubuntu.

== Feedback and Helping ==

If you would like to help shape Ubuntu, take a look at the list of
ways you can participate at

  http://www.ubuntu.com/community/participate/

Your comments, bug reports, patches and suggestions will help ensure
that our next release is the best release of Ubuntu ever.  If you feel
that you have found a bug please read:

  http://help.ubuntu.com/community/ReportingBugs

Then report bugs using apport in Ubuntu.  For example:

  ubuntu-bug linux

will open a bug report in Launchpad regarding the linux package.

If you have a question, or if you think you may have found a bug but
aren't sure, first try asking on the #ubuntu or #ubuntu-bugs IRC
channels on Libera.Chat, on the Ubuntu Users mailing list, or on the
Ubuntu forums:

  http://help.ubuntu.com/community/InternetRelayChat
  http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
  http://www.ubuntuforums.org/


== More Information ==

You can find out more about Ubuntu on our website, IRC channel and wiki.
If you're new to Ubuntu, please visit:

  http://www.ubuntu.com/

To sign up for future Ubuntu announcements, please subscribe to Ubuntu's
very low volume announcement list at:

  http://lists.ubuntu.com/mailman/listinfo/ubuntu-announce


Continue [yN] y

同意在 sources.list 文件中更新存储库内容。

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Hit https://mirror.hetzner.com/ubuntu/packages jammy InRelease
Hit https://mirror.hetzner.com/ubuntu/packages jammy-updates InRelease
Hit https://mirror.hetzner.com/ubuntu/packages jammy-backports InRelease
Hit https://mirror.hetzner.com/ubuntu/security jammy-security InRelease
Fetched 0 B in 0s (0 B/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done

Updating repository information

No valid mirror found

While scanning your repository information no mirror entry for the
upgrade was found. This can happen if you run an internal mirror or
if the mirror information is out of date.

Do you want to rewrite your 'sources.list' file anyway? If you choose
'Yes' here it will update all 'jammy' to 'mantic' entries.
If you select 'No' the upgrade will cancel.

Continue [yN] y

y两次将系统软件包升级到新存储库中设置的最新版本。

2 packages are going to be removed. 73 new packages are going to be
installed. 513 packages are going to be upgraded.

You have to download a total of 782 M. This download will take about
3 minutes with your connection.

Installing the upgrade can take several hours. Once the download has
finished, the process cannot be canceled.

 Continue [yN]  Details [d] y
Continue [yN]  Details [d] y

升级完成后删除过时的软件包。

Remove obsolete packages?


40 packages are going to be removed.

 Continue [yN]  Details [d] y
Continue [yN]  Details [d] y

System upgrade is complete.

Restart required

To finish the upgrade, a restart is required.
If you select 'y' the system will be restarted.

Continue [yN] y

如果出现提示时按y,系统将重新启动。登录后,手动检查某些软件包是否需要自动删除 - 过时的软件包。

$ sudo apt autoremove
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  gcc-12-base libblockdev-crypto2 libblockdev-fs2 libblockdev-loop2 libblockdev-part-err2 libblockdev-part2 libblockdev-swap2 libblockdev-utils2 libblockdev2 libbpf0 libdns-export1110 libicu70
  libisc-export1105 libldap-2.5-0 libmpdec3 libparted-fs-resize0 libpcre3 libperl5.34 libpython3.10 libpython3.10-minimal libpython3.10-stdlib linux-image-5.15.0-91-generic
  linux-modules-5.15.0-91-generic perl-modules-5.34 python3.10 python3.10-minimal
0 upgraded, 0 newly installed, 26 to remove and 0 not upgraded.
After this operation, 241 MB disk space will be freed.
Do you want to continue? [Y/n] y

新操作系统版本的详细信息可在 /etc/os-release 文件中找到。

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 23.10"
NAME="Ubuntu"
VERSION_ID="23.10"
VERSION="23.10 (Mantic Minotaur)"
VERSION_CODENAME=mantic
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/";
SUPPORT_URL="https://help.ubuntu.com/";
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/";
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy";
UBUNTU_CODENAME=mantic
LOGO=ubuntu-logo

检查是否有任何新的升级可用。如果您在 Ubuntu 24.04 发布时使用本指南,那么您将会看到它。

$ sudo do-release-upgrade
Checking for a new Ubuntu release
No new release found.

在等待 Ubuntu 24.04 LTS 正式发布的同时,尽情使用 Ubuntu 23.10。

请参阅以下书籍,帮助您学习 Linux 系统。

  • 最佳 Linux 内核编程书籍
  • 适合初学者和专家的最佳 Linux 书籍
  • 最佳 Linux Bash 脚本书籍
  • 顶级 RHCSA/RHCE 认证学习书籍
  • 最受好评的 CompTIA A+ 认证书籍
  • 最佳 LPIC-1 和 LPIC-2 认证学习书籍

更新于:1个月前
赞一波!

文章评论

全部评论