从命令行中将Fedora 37升级到Fedora Linux 38

本文介绍如何从命令行中将Fedora 37升级到Fedora Linux 38的方法,全程在命令行(终端)中进行操作,适用于Fedora 38 Workstation/Server(工作站/服务器)版本。

从命令行中将Fedora 37升级到Fedora Linux 38

将Fedora 37 Workstation/Server升级到Fedora Linux 38的操作方法

1、更新Fedora 37 Workstation/Server系统

在我们启动升级之前,请确保所有系统包都是最新的,执行以下命令即可:

sudo dnf -y upgrade

更新后,请重新启动计算机:

sudo systemctl reboot

验证您正在使用的系统是Fedora 37:

$ cat /etc/redhat-release

Fedora release 37 (Thirty Seven)

注:如果想全新安装Fedora Linux 38,请阅读https://www.hmxthome.com/linux/5139.html里面的文章。

2、建议备份系统

强烈建议您在进行重大升级之前对文档和文件进行系统备份。可以对网络中的外部驱动器或其他系统进行备份。

3、从Fedora 37升级至Fedora 38

检查是否有任何新的更新可用:

sudo dnf upgrade --refresh

应用任何可能可用的更新,然后安装DNF插件:

sudo dnf -y install dnf-plugin-system-upgrade

安装dnf-plugin-system-upgrade后,开始将Fedora 37升级到Fedora 38。以root用户或具有sudo权限的用户身份在终端中执行以下命令:

sudo dnf system-upgrade download --releasever=38

注:请注意,后面的38代表Fedora 38版本。即如果您想升级到不同版本的Fedora,请更改--releasever=数字。

按至y键以接受系统升级:

Before you continue ensure that your system is fully upgraded by running "dnf --refresh upgrade". Do you want to continue [y/N]: y

我们刚刚执行的命令将在您的机器为实际升级做准备时在本地下载所有升级。

注意:如果您有中断的依赖关系或失效的包阻止升级,请使用该命令:

sudo dnf system-upgrade download --releasever=38 --allowerasing

下载了许多软件包,确保您有稳定的互联网连接,以下是大致返回信息:

Install 6 Packages

Upgrade 405 Packages

Downgrade 7 Packages

Total download size: 249 M

DNF will only download packages, install gpg keys, and check the transaction.

Is this ok [y/N]: y

注:按y键回车继续。

在本地下载软件包后,使用以下命令触发升级过程:

sudo dnf system-upgrade reboot

系统将重新启动并完成升级过程。

一旦升级过程完成,系统将第二次重新启动,然后进入到Fedora 38新操作系统版本中:

$ neofetch

返回的信息如下:

OS: Fedora Linux 38 (Thirty Eight) x86_64

Host: vServer 20171111

Kernel: 6.2.11-300.fc38.x86_64

Uptime: 5 mins

Packages: 623 (rpm)

Shell: bash 5.2.15

Resolution: 1024x768

Terminal: /dev/pts/0

CPU: Intel Xeon (Skylake, IBRS) (2) @ 2.099GHz

GPU: 00:02.0 Vendor 1234 Device 1111

Memory: 153MiB / 3805MiB

注:CPU、GPU、内存是自己计算机的配置。

4、更新配置文件,此步骤是可选择的操作

rpmconf命令行工具可以帮助您搜索.rpmnew、.rpmsave和.rpmorig文件,并询问您如何处理它们。您可以选择以下项目:

1]、保留当前版本(新软件包维护者的版本)。

2]、替换为以前的版本(返回原始文件)。

3]、查看版本之间的差异。

通过输入命令安装rpmconf软件包:

sudo dnf -y install rpmconf

然后使用它检查更改的配置文件:

sudo rpmconf -a

-a,--all命令选项允许您检查所有更新的包的配置文件。

参见以下示例:

Configuration file '/boot/efi/EFI/fedora/grub.cfg'

-rwx------. 1 root root 6696 Oct 26 05:39 /boot/efi/EFI/fedora/grub.cfg.rpmsave

-rwx------. 1 root root  143 Oct 26 05:39 /boot/efi/EFI/fedora/grub.cfg

==> Package distributor has shipped an updated version.

==> Maintainer forced upgrade. Your old version has been backed up.

What would you like to do about it?  Your options are:

Y or I : install (keep) the package maintainer's version

N or O : return back to your original file

D : show the differences between the versions

M : merge configuration files

Z : background this process to examine the situation

S : skip this file

The default action is to keep package maintainer's version.

*** aliases (Y/I/N/O/M/D/Z/S) [default=Y] ?

Your choice: Y

5、删除失效的程序包,此步骤是可选择的操作

随着Fedora有新版本的发布,又由于多种原因,一些包都会退役。强烈建议删除这些程序包。

安装/删除已失效的软件包,包名为remove-retired-packages:

sudo dnf install remove-retired-packages

运行命令以删除失效的包:

sudo remove-retired-packages

至此,达到了删除失效的程序包的目的。

结论

以上就是从命令行中将Fedora 37升级到Fedora Linux 38系统的方法,适用于升级到Fedora 38工作站或服务器版本。

栏目相关文章