更新时间:2023-01-25 16:00:47浏览次数:394+次
本文介绍从RHEL 8升级到RHEL 9(Red Hat Enterprise Linux 9)系统版本的方法。
从RHEL 8升级到RHEL 9 Linux的步骤
1、准备RHEL 8服务器
在继续之前,请确保您的Red Hat Enterprise Linux Server订阅正常。这可以使用以下命令进行验证:
sudo subscription-manager list --installed
得返回Subscribed字样。
同时,请确保RHEL 8系统上已启用基本存储库:
$ sudo subscription-manager repos --enable rhel-8-for-x86_64-baseos-rpms --enable rhel-8-for-x86_64-appstream-rpms
1 local certificate has been deleted.
Repository 'rhel-8-for-x86_64-baseos-rpms' is enabled for this system.
Repository 'rhel-8-for-x86_64-appstream-rpms' is enabled for this system.
在AWS(仅限)上,您必须启用RHUI才能进行升级:
sudo dnf config-manager –set-enabled rhui-client-config-server-8
sudo dnf -y install rh-amazon-rhui-client-ha leapp-rhui-aws
如果您以前从RHEL 7升级到RHEL 8,则需要删除tmp_leapp_py3目录:
sudo rm -rf /root/tmp_leapp_py3
将系统和可用软件包更新到最新版本:
sudo dnf update
2、安装Leapp实用程序
Leapp实用程序通过自动化整个升级过程,提供了一种升级系统的简单方法。
可以使用以下命令安装此工具:
sudo dnf install leapp-upgrade
删除versionlock插件。用于将包锁定到特定版本:
sudo dnf versionlock clear
3、执行升级前检查
执行升级前检查时,leapp实用程序会在/var/log/leapp/leapp-report.txt中创建一个文件,其中包含所有可能的问题及其建议的解决方案。
但在此之前,我们需要禁用防火墙上的AllowZoneDrifting:
sudo vim /etc/firewalld/firewalld.conf
在文件末尾,通过注释禁用该功能,如下所示:
# AllowZoneDrifting
# Older versions of firewalld had undocumented behavior known as "zone
# drifting". This allowed packets to ingress multiple zones - this is a
# violation of zone based firewalls. However, some users rely on this behavior
# to have a "catch-all" zone, e.g. the default zone. You can enable this if you
# desire such behavior. It's disabled by default for security reasons.
# Note: If "yes" packets will only drift from source based zones to interface
# based zones (including the default zone). Packets never drift from interface
# based zones to other interfaces based zones (including the default zone).
# Possible values; "yes", "no". Defaults to "yes".
#AllowZoneDrifting=yes
禁用SELinux或将其设置为许可模式:
sudo setenforce 0
现在使用以下命令执行升级前检查:
sudo leapp preupgrade --target 9.0
如果一切正常,您将看到以下输出:
4、从RHEL 8升级到RHEL 9
检查成功后,您可以使用leapp实用程序继续并升级系统:
sudo leapp upgrade --target 9.0
样本输出:
现在重新启动系统:
sudo reboot
此时会出现名为RHEL-Upgrade-Initramfs的GRUB条目。系统将自动引导到此选项:
系统升级将如图所示:
升级RHEL 9后的检查
一旦过程完成,我们需要验证一些事情。如果您正在运行桌面服务器,您将看到一个漂亮的桌面环境:
请检查当前版本,执行以下命令:
cat /etc/os-release
输出:
会看到已升级到Red Hat Enterprise Linux 9版本。然后验证系统是否订阅了Red Hat Enterprise Linux Server计划:
sudo subscription-manager list --installed
会返回Subscribed字样。
至此,从RHEL 8升级到RHEL 9成功完成。