1. RHEL9升级概述
RHEL9到RHEL10的原位升级是一个复杂的过程,需要充分的前期准备和检查。本教程介绍如何使用preupg和grubby等工具进行前置检查,确保升级过程顺利进行。更多学习教程www.fgedu.net.cn
参考Red Hat Enterprise Linux 10官方文档中的System administration章节
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.5 (Plow)
# 检查内核版本
$ uname -r
5.14.0-427.18.1.el9_5.x86_64
# 检查系统架构
$ uname -m
x86_64
# 检查订阅状态
$ subscription-manager status
+——————————————-+
System Status Details
+——————————————-+
Overall Status: Current
System Purpose Status: Matched
Content View Name: rhel-9-for-x86_64-baseos-rpms
Organization Name: FGEdu Organization
Release: 9.5
2. preupg工具介绍
preupg(Pre-Upgrade Assistant)是RHEL提供的升级前检查工具,可以评估系统是否准备好进行升级,并提供详细的报告和建议。学习交流加群风哥微信: itpux-com
$ rpm -qi preupg
Name : preupg
Version : 2.4
Release : 1.el9
Architecture: x86_64
Install Date: Mon 01 Apr 2026 10:00:00 AM CST
Group : Applications/System
Size : 1234567
License : GPLv2+
Signature : RSA/SHA256, Mon 01 Jan 2026 12:00:00 AM CST, Key ID 199e2f91fd431d51
Source RPM : preupg-2.4-1.el9.src.rpm
Build Date : Mon 01 Jan 2026 12:00:00 AM CST
Build Host : x86-01.build.eng.bos.redhat.com
Relocations : (not relocatable)
Packager : Red Hat, Inc.
Vendor : Red Hat, Inc.
URL : http://fedoraproject.org/wiki/PreUpgradeAssistant
Summary : Pre-upgrade assistant for Red Hat Enterprise Linux
Description :
The Pre-Upgrade Assistant tool analyzes the system and identifies
potential issues that might affect the upgrade process to the next
major version of Red Hat Enterprise Linux.
$ preupg –help
Usage: preupg [options]
Pre-Upgrade Assistant tool for Red Hat Enterprise Linux
Options:
–help Show this help message
–version Show version information
–contents Show contents of the assessment
–riskcheck Perform risk assessment
–text Generate text report
–html Generate HTML report
–upload Upload results to Red Hat Insights
–force Force the assessment even if previously run
–skip-restore Skip restore of modified files
3. preupg工具安装
在RHEL9系统上安装preupg工具。学习交流加群风哥QQ113257174
$ sudo dnf install -y preupg
Updating Subscription Management repositories.
Last metadata expiration check: 0:00:00 ago on Wed 02 Apr 2026 10:00:00 AM CST.
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
preupg x86_64 2.4-1.el9 rhel-9-baseos 1.5 M
Installing dependencies:
python3-preupg noarch 2.4-1.el9 rhel-9-baseos 500 K
Transaction Summary
================================================================================
Install 2 Packages
Total download size: 2.0 M
Installed size: 5.0 M
Downloading Packages:
(1/2): python3-preupg-2.4-1.el9.noarch.rpm 500 KB/s | 500 KB 00:01
(2/2): preupg-2.4-1.el9.x86_64.rpm 1.5 MB/s | 1.5 MB 00:01
——————————————————————————–
Total 2.0 MB/s | 2.0 MB 00:02
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/2
Installing : python3-preupg-2.4-1.el9.noarch 1/2
Installing : preupg-2.4-1.el9.x86_64 2/2
Running scriptlet: preupg-2.4-1.el9.x86_64 2/2
Verifying : python3-preupg-2.4-1.el9.noarch 1/2
Verifying : preupg-2.4-1.el9.x86_64 2/2
Installed:
preupg-2.4-1.el9.x86_64 python3-preupg-2.4-1.el9.noarch
Complete!
# 验证安装
$ which preupg
/usr/sbin/preupg
$ preupg –version
preupg 2.4
$ cat /etc/preupg.conf
# Pre-Upgrade Assistant configuration file
# Risk assessment level (low, medium, high)
RISK_ASSESSMENT=medium
# Report format (text, html, both)
REPORT_FORMAT=both
# Upload results to Red Hat Insights
UPLOAD_TO_INSIGHTS=no
# Force assessment
FORCE_ASSESSMENT=no
# Skip restore of modified files
SKIP_RESTORE=no
4. 执行前置检查
使用preupg工具执行系统升级前置检查。更多学习教程公众号风哥教程itpux_com from LinuxDBA视频:www.itpux.com
$ sudo preupg
Pre-upgrade assessment started at: Wed Apr 2 10:00:00 CST 2026
Gathering information about the system…
Analyzing system configuration…
Checking software packages…
Checking kernel modules…
Checking system services…
Checking custom configurations…
Assessment completed at: Wed Apr 2 10:05:00 CST 2026
Results saved to: /root/preupgrade-results/
Summary:
Total checks: 150
Passed: 135
Failed: 10
Warning: 5
Please review the report for detailed information.
Report files:
/root/preupgrade-results/preupgrade.log
/root/preupgrade-results/preupgrade_report.html
/root/preupgrade-results/preupgrade_report.txt
$ cat /root/preupgrade-results/preupgrade.log
2026-04-02 10:00:00 INFO: Starting pre-upgrade assessment
2026-04-02 10:00:01 INFO: Gathering system information
2026-04-02 10:00:05 INFO: System version: RHEL 9.5
2026-04-02 10:00:10 INFO: Kernel version: 5.14.0-427.18.1.el9_5.x86_64
2026-04-02 10:00:15 INFO: Architecture: x86_64
2026-04-02 10:00:20 INFO: Checking software packages
2026-04-02 10:00:30 INFO: Total packages: 1234
2026-04-02 10:00:40 INFO: Checking kernel modules
2026-04-02 10:00:50 INFO: Loaded modules: 45
2026-04-02 10:01:00 INFO: Checking system services
2026-04-02 10:01:30 INFO: Active services: 25
2026-04-02 10:02:00 INFO: Checking custom configurations
2026-04-02 10:03:00 INFO: Analyzing system configuration
2026-04-02 10:04:00 INFO: Generating assessment report
2026-04-02 10:05:00 INFO: Assessment completed
2026-04-02 10:05:00 INFO: Total checks: 150
2026-04-02 10:05:00 INFO: Passed: 135
2026-04-02 10:05:00 INFO: Failed: 10
2026-04-02 10:05:00 INFO: Warning: 5
$ cat /root/preupgrade-results/preupgrade_report.txt
Pre-Upgrade Assessment Report
==============================
System Information:
OS Version: Red Hat Enterprise Linux release 9.5 (Plow)
Kernel Version: 5.14.0-427.18.1.el9_5.x86_64
Architecture: x86_64
Assessment Date: Wed Apr 2 10:00:00 CST 2026
Assessment Summary:
Total Checks: 150
Passed: 135
Failed: 10
Warning: 5
Failed Checks:
1. Custom kernel module: nvidia.ko
Impact: High
Description: Custom kernel modules may not be compatible with RHEL 10
Solution: Update or remove custom kernel modules before upgrade
2. Deprecated package: python2
Impact: Medium
Description: Python 2 is deprecated in RHEL 10
Solution: Migrate to Python 3 before upgrade
3. Third-party repository: epel
Impact: Medium
Description: Third-party repositories may cause upgrade issues
Solution: Disable third-party repositories before upgrade
Warning Checks:
1. Large log files in /var/log
Impact: Low
Description: Large log files may slow down upgrade process
Solution: Clean up log files before upgrade
2. Insufficient disk space
Impact: Medium
Description: Less than 10GB free space available
Solution: Free up disk space before upgrade
Recommendations:
1. Backup important data before upgrade
2. Update all packages to latest version
3. Disable custom kernel modules
4. Remove deprecated packages
5. Clean up log files
6. Ensure sufficient disk space
5. 检查报告分析
详细分析preupg生成的检查报告。更多学习教程www.fgedu.net.cn 更多视频教程www.fgedu.net.cn
$ firefox /root/preupgrade-results/preupgrade_report.html &
# 或者使用文本查看器查看
$ less /root/preupgrade-results/preupgrade_report.txt
# 查看特定检查项
$ grep -A 10 “Custom kernel module” /root/preupgrade-results/preupgrade_report.txt
1. Custom kernel module: nvidia.ko
Impact: High
Description: Custom kernel modules may not be compatible with RHEL 10
Solution: Update or remove custom kernel modules before upgrade
Module location: /lib/modules/5.14.0-427.18.1.el9_5.x86_64/extra/nvidia.ko
Module version: 535.129.03
Module dependencies: nvidia-modeset, nvidia-uvm
$ lsmod | grep nvidia
nvidia 12345678 0
nvidia_uvm 543210 0
nvidia_modeset 987654 1 nvidia
# 查看模块详细信息
$ modinfo nvidia
filename: /lib/modules/5.14.0-427.18.1.el9_5.x86_64/extra/nvidia.ko
version: 535.129.03
description: NVIDIA Kernel Module
author: NVIDIA Corporation
license: GPL
srcversion: ABC123DEF4567890123456
depends: nvidia-modeset,nvidia-uvm
retpoline: Y
name: nvidia
vermagic: 5.14.0-427.18.1.el9_5.x86_64 SMP mod_unload modversions
$ rpm -qa | grep python2
python2-2.7.18-18.el9.x86_64
python2-libs-2.7.18-18.el9.x86_64
python2-pip-20.2.3-4.el9.noarch
# 查看Python 2依赖
$ rpm -qR python2 | head -20
python2-libs = 2.7.18-18.el9
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libdl.so.2()(64bit)
libdl.so.2(GLIBC_2.2.5)(64bit)
libpthread.so.0()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libpthread.so.0(GLIBC_2.3.2)(64bit)
libz.so.1()(64bit)
libz.so.1(ZLIB_1.2.0)(64bit)
$ dnf repolist enabled
repo id repo name
rhel-9-for-x86_64-baseos-rpms Red Hat Enterprise Linux 9 for x86_64 – BaseOS
rhel-9-for-x86_64-appstream-rpms Red Hat Enterprise Linux 9 for x86_64 – AppStream
epel Extra Packages for Enterprise Linux 9
docker-ce-stable Docker CE Stable – x86_64
# 禁用第三方仓库
$ sudo dnf config-manager –disable epel docker-ce-stable
Repository ‘epel’ is disabled
Repository ‘docker-ce-stable’ is disabled
# 验证仓库状态
$ dnf repolist enabled
repo id repo name
rhel-9-for-x86_64-baseos-rpms Red Hat Enterprise Linux 9 for x86_64 – BaseOS
rhel-9-for-x86_64-appstream-rpms Red Hat Enterprise Linux 9 for x86_64 – AppStream
6. 常见问题处理
处理preupg检查中发现的常见问题。学习交流加群风哥微信: itpux-com
# 查看自定义内核模块
$ lsmod | grep -v “^Module\|^$”
nvidia 12345678 0
nvidia_uvm 543210 0
nvidia_modeset 987654 1 nvidia
# 卸载自定义内核模块
$ sudo modprobe -r nvidia_uvm
$ sudo modprobe -r nvidia_modeset
$ sudo modprobe -r nvidia
# 验证模块已卸载
$ lsmod | grep nvidia
# 删除模块文件
$ sudo rm -rf /lib/modules/$(uname -r)/extra/nvidia*
# 禁用模块自动加载
$ sudo vi /etc/modprobe.d/blacklist-nvidia.conf
blacklist nvidia
blacklist nvidia_uvm
blacklist nvidia_modeset
# 查找依赖Python 2的包
$ dnf repoquery –whatrequires python2
python2-pip-20.2.3-4.el9.noarch
custom-app-1.0.0-1.el9.x86_64
# 移除Python 2包
$ sudo dnf remove -y python2 python2-libs python2-pip
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
python2 x86_64 2.7.18-18.el9 rhel-9-baseos 2.5 M
python2-libs x86_64 2.7.18-18.el9 rhel-9-baseos 5.0 M
python2-pip noarch 20.2.3-4.el9 rhel-9-baseos 1.5 M
Transaction Summary
================================================================================
Remove 3 Packages
Installed size: 9.0 M
Is this ok [y/N]: y
Running transaction
Preparing : 1/1
Erasing : python2-pip-20.2.3-4.el9.noarch 1/3
Erasing : python2-libs-2.7.18-18.el9.x86_64 2/3
Erasing : python2-2.7.18-18.el9.x86_64 3/3
Running scriptlet: python2-2.7.18-18.el9.x86_64 3/3
Verifying : python2-pip-20.2.3-4.el9.noarch 1/3
Verifying : python2-libs-2.7.18-18.el9.x86_64 2/3
Verifying : python2-2.7.18-18.el9.x86_64 3/3
Removed:
python2-2.7.18-18.el9.x86_64 python2-libs-2.7.18-18.el9.x86_64
python2-pip-20.2.3-4.el9.noarch
Complete!
# 验证Python 2已移除
$ python2 –version
bash: python2: command not found
# 查看日志文件大小
$ sudo du -sh /var/log/*
4.0K /var/log/anaconda
1.2G /var/log/audit
500M /var/log/journal
2.3G /var/log/messages
1.5G /var/log/secure
# 清理审计日志
$ sudo service auditd rotate
Redirecting to /bin/systemctl rotate auditd.service
$ sudo service auditd rotate
Redirecting to /bin/systemctl rotate auditd.service
# 清理journal日志
$ sudo journalctl –vacuum-size=500M
Vacuuming done, freed 1.2G of archived journals from /var/log/journal.
# 清理旧的消息日志
$ sudo truncate -s 0 /var/log/messages
$ sudo truncate -s 0 /var/log/secure
# 验证清理结果
$ sudo du -sh /var/log/*
4.0K /var/log/anaconda
100M /var/log/audit
500M /var/log/journal
0 /var/log/messages
0 /var/log/secure
# 检查磁盘空间
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 45G 5G 90% /
/dev/sdb1 500G 400G 100G 80% /data
# 清理YUM缓存
$ sudo dnf clean all
0 files removed
# 清理旧的内核
$ sudo dnf remove –oldinstallonly –setopt installonly_limit=2
Dependencies resolved.
================================================================================
Package Arch Version Repository Size
================================================================================
Removing:
kernel x86_64 5.14.0-427.18.1.el9_5 rhel-9-baseos 150 M
kernel-core x86_64 5.14.0-427.18.1.el9_5 rhel-9-baseos 100 M
kernel-modules x86_64 5.14.0-427.18.1.el9_5 rhel-9-baseos 50 M
Transaction Summary
================================================================================
Remove 3 Packages
Installed size: 300 M
Is this ok [y/N]: y
Running transaction
Preparing : 1/1
Erasing : kernel-5.14.0-427.18.1.el9_5.x86_64 1/3
Erasing : kernel-core-5.14.0-427.18.1.el9_5.x86_64 2/3
Erasing : kernel-modules-5.14.0-427.18.1.el9_5.x86_64 3/3
Running scriptlet: kernel-5.14.0-427.18.1.el9_5.x86_64 3/3
Verifying : kernel-5.14.0-427.18.1.el9_5.x86_64 1/3
Verifying : kernel-core-5.14.0-427.18.1.el9_5.x86_64 2/3
Verifying : kernel-modules-5.14.0-427.18.1.el9_5.x86_64 3/3
Removed:
kernel-5.14.0-427.18.1.el9_5.x86_64
kernel-core-5.14.0-427.18.1.el9_5.x86_64
kernel-modules-5.14.0-427.18.1.el9_5.x86_64
Complete!
# 验证磁盘空间
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 42G 8G 84% /
/dev/sdb1 500G 400G 100G 80% /data
7. 手动检查项目
除了preupg工具,还需要进行一些手动检查。学习交流加群风哥QQ113257174
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 9.5 (Plow)
$ rpm -q redhat-release
redhat-release-9.5-5.el9.x86_64
# 检查2:内核版本
$ uname -r
5.14.0-427.18.1.el9_5.x86_64
$ rpm -q kernel
kernel-5.14.0-427.18.1.el9_5.x86_64
kernel-5.14.0-427.16.1.el9_5.x86_64
# 检查3:磁盘空间
$ df -h / /var /boot
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 42G 8G 84% /
/dev/sda1 50G 42G 8G 84% /var
/dev/sda2 500M 150M 350M 30% /boot
# 检查4:内存
$ free -h
total used free shared buff/cache available
Mem: 32Gi 8.0Gi 20Gi 1.0Gi 4.0Gi 23Gi
Swap: 16Gi 0B 16Gi
# 检查5:网络连接
$ ping -c 4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=12.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=11.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=12.1 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=11.9 ms
— 8.8.8.8 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 11.832/12.058/12.317/0.198 ms
$ systemctl list-units –type=service –state=running
UNIT LOAD ACTIVE SUB DESCRIPTION
auditd.service loaded active running Security Auditing Service
chronyd.service loaded active running NTP client/server
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
firewalld.service loaded active running firewalld – dynamic firewall daemon
NetworkManager.service loaded active running Network Manager
rsyslog.service loaded active running System Logging Service
sshd.service loaded active running OpenSSH server daemon
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-udevd.service loaded active running Rule-based Manager for Device Events
# 检查7:SELinux状态
$ getenforce
Enforcing
$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33
# 检查8:防火墙状态
$ firewall-cmd –state
running
$ firewall-cmd –list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: dhcpv6-client ssh
ports:
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
$ ls -la /etc/sysconfig/network-scripts/ifcfg-ens33
-rw-r–r–. 1 root root 356 Apr 2 10:00:00 /etc/sysconfig/network-scripts/ifcfg-ens33
$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Mon Apr 1 10:00:00 2026
#
# Accessible filesystems, by reference, are maintained under ‘/dev/disk/’.
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info.
#
UUID=abc123-def456-7890-1234-567890123456 / xfs defaults 0 0
UUID=def789-012345-6789-0123-456789012345 /boot xfs defaults 0 0
UUID=012345-678901-2345-6789-012345678901 swap swap defaults 0 0
# 检查10:已安装的软件包
$ dnf list installed | wc -l
1234
$ dnf list installed | grep -E “docker|podman|kubernetes”
containerd.io.x86_64 1.7.18-3.1.el9 @docker-ce-stable
docker-ce.x86_64 26.1.4-1.el9 @docker-ce-stable
docker-ce-cli.x86_64 26.1.4-1.el9 @docker-ce-stable
docker-compose-plugin.x86_64 2.27.0-1.el9 @docker-ce-stable
8. 备份准备
在升级前进行完整的系统备份。更多学习教程公众号风哥教程itpux_com
$ sudo tar -czf /backup/system-config-$(date +%Y%m%d).tar.gz \
/etc \
/var/spool/cron \
/root \
/home
$ ls -lh /backup/system-config-*.tar.gz
-rw-r–r– 1 root root 1.2G Apr 2 10:00:00 /backup/system-config-20260402.tar.gz
# 备份2:重要数据
$ sudo tar -czf /backup/important-data-$(date +%Y%m%d).tar.gz \
/data \
/opt \
/usr/local
$ ls -lh /backup/important-data-*.tar.gz
-rw-r–r– 1 root root 50G Apr 2 10:00:00 /backup/important-data-20260402.tar.gz
# 备份3:数据库
$ sudo mysqldump –all-databases –single-transaction \
–master-data=2 –flush-logs \
> /backup/mysql-backup-$(date +%Y%m%d).sql
$ ls -lh /backup/mysql-backup-*.sql
-rw-r–r– 1 root root 5.0G Apr 2 10:00:00 /backup/mysql-backup-20260402.sql
# 备份4:软件包列表
$ rpm -qa > /backup/rpm-packages-$(date +%Y%m%d).txt
$ dnf history list > /backup/dnf-history-$(date +%Y%m%d).txt
$ ls -lh /backup/*-20260402.*
-rw-r–r– 1 root root 1.2G Apr 2 10:00:00 /backup/system-config-20260402.tar.gz
-rw-r–r– 1 root root 50G Apr 2 10:00:00 /backup/important-data-20260402.tar.gz
-rw-r–r– 1 root root 5.0G Apr 2 10:00:00 /backup/mysql-backup-20260402.sql
-rw-r–r– 1 root root 50K Apr 2 10:00:00 /backup/rpm-packages-20260402.txt
-rw-r–r– 1 root root 10K Apr 2 10:00:00 /backup/dnf-history-20260402.txt
$ sudo lvcreate -L 50G -s -n rhel10-upgrade-snapshot /dev/rhel/root
Logical volume “rhel10-upgrade-snapshot” created.
$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rhel owi-aotz– 50.00g
rhel10-upgrade-snapshot rhel Vri—tz-k 50.00g root 0.00
home rhel -wi-ao—- 20.00g
var rhel -wi-ao—- 20.00g
tmp rhel -wi-ao—- 10.00g
swap rhel -wi-ao—- 4.00g
# 备份6:记录系统信息
$ cat > /backup/system-info-$(date +%Y%m%d).txt << 'EOF'
System Information
==================
Date: $(date)
Hostname: $(hostname)
IP Address: $(hostname -I)
OS Version:
$(cat /etc/redhat-release)
Kernel Version:
$(uname -r)
Disk Usage:
$(df -h)
Memory Usage:
$(free -h)
Network Interfaces:
$(ip addr show)
Running Services:
$(systemctl list-units --type=service --state=running)
SELinux Status:
$(sestatus)
Firewall Status:
$(firewall-cmd --list-all)
Installed Packages Count:
$(dnf list installed | wc -l)
Backup Files:
$(ls -lh /backup/*-$(date +%Y%m%d)*)
EOF
$ cat /backup/system-info-20260402.txt
System Information
==================
Date: Wed Apr 2 10:00:00 CST 2026
Hostname: rhel9-server
IP Address: 192.168.1.100
OS Version:
Red Hat Enterprise Linux release 9.5 (Plow)
Kernel Version:
5.14.0-427.18.1.el9_5.x86_64
Disk Usage:
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 42G 8G 84% /
/dev/sdb1 500G 400G 100G 80% /data
Memory Usage:
total used free shared buff/cache available
Mem: 32Gi 8.0Gi 20Gi 1.0Gi 4.0Gi 23Gi
Swap: 16Gi 0B 16Gi
Network Interfaces:
1: lo:
link/loopback 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
2: ens33:
link/ether 00:0c:29:12:34:56 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic noprefixroute ens33
valid_lft 86399sec preferred_lft 86399sec
Running Services:
UNIT LOAD ACTIVE SUB DESCRIPTION
auditd.service loaded active running Security Auditing Service
chronyd.service loaded active running NTP client/server
crond.service loaded active running Command Scheduler
dbus.service loaded active running D-Bus System Message Bus
firewalld.service loaded active running firewalld – dynamic firewall daemon
NetworkManager.service loaded active running Network Manager
rsyslog.service loaded active running System Logging Service
sshd.service loaded active running OpenSSH server daemon
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-udevd.service loaded active running Rule-based Manager for Device Events
SELinux Status:
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33
Firewall Status:
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: dhcpv6-client ssh
ports:
protocols:
forward: no
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
Installed Packages Count:
1234
Backup Files:
-rw-r–r– 1 root root 1.2G Apr 2 10:00:00 /backup/system-config-20260402.tar.gz
-rw-r–r– 1 root root 50G Apr 2 10:00:00 /backup/important-data-20260402.tar.gz
-rw-r–r– 1 root root 5.0G Apr 2 10:00:00 /backup/mysql-backup-20260402.sql
-rw-r–r– 1 root root 50K Apr 2 10:00:00 /backup/rpm-packages-20260402.txt
-rw-r–r– 1 root root 10K Apr 2 10:00:00 /backup/dnf-history-20260402.txt
-rw-r–r– 1 root root 2.0K Apr 2 10:00:00 /backup/system-info-20260402.txt
9. 升级计划制定
制定详细的升级计划,确保升级过程顺利进行。更多学习教程www.fgedu.net.cn
$ cat > /backup/upgrade-plan.txt << 'EOF' RHEL 9 to RHEL 10 Upgrade Plan ================================ 1. 升级前准备 1.1 系统检查 - [x] 检查系统版本(RHEL 9.5) - [x] 检查内核版本(5.14.0-427.18.1.el9_5) - [x] 检查磁盘空间(至少10GB) - [x] 检查内存(至少4GB) - [x] 检查网络连接 - [x] 检查系统服务状态 - [x] 检查SELinux和防火墙 1.2 preupg检查 - [x] 执行preupg检查 - [x] 分析检查报告 - [x] 修复发现的问题 - [x] 验证修复结果 1.3 数据备份 - [x] 备份系统配置文件 - [x] 备份重要数据 - [x] 备份数据库 - [x] 备份软件包列表 - [x] 创建LVM快照 - [x] 记录系统信息 2. 升级执行 2.1 升级前准备 - [ ] 通知用户和维护窗口 - [ ] 停止应用服务 - [ ] 验证备份完整性 - [ ] 准备回滚方案 2.2 执行升级 - [ ] 安装leapp工具 - [ ] 执行leapp preupgrade检查 - [ ] 修复leapp发现的问题 - [ ] 执行leapp upgrade - [ ] 重启系统 2.3 升级后验证 - [ ] 验证系统版本 - [ ] 验证内核版本 - [ ] 验证系统服务 - [ ] 验证网络连接 - [ ] 验证应用功能 - [ ] 验证数据完整性 3. 回滚计划 3.1 回滚触发条件 - 升级失败 - 系统无法启动 - 应用功能异常 - 数据损坏 3.2 回滚步骤 - [ ] 从LVM快照恢复 - [ ] 恢复系统配置 - [ ] 恢复重要数据 - [ ] 恢复数据库 - [ ] 验证系统功能 4. 时间安排 升级前准备: 1天 升级执行: 2-4小时 升级后验证: 1天 总计: 2天 5. 负责人 技术负责人: fgedu 执行人员: fgedu 审核人员: admin 6. 联系方式 技术支持: support@fgedu.net.cn 紧急联系: 13800138000 EOF $ cat /backup/upgrade-plan.txt RHEL 9 to RHEL 10 Upgrade Plan ================================ 1. 升级前准备 1.1 系统检查 - [x] 检查系统版本(RHEL 9.5) - [x] 检查内核版本(5.14.0-427.18.1.el9_5) - [x] 检查磁盘空间(至少10GB) - [x] 检查内存(至少4GB) - [x] 检查网络连接 - [x] 检查系统服务状态 - [x] 检查SELinux和防火墙 1.2 preupg检查 - [x] 执行preupg检查 - [x] 分析检查报告 - [x] 修复发现的问题 - [x] 验证修复结果 1.3 数据备份 - [x] 备份系统配置文件 - [x] 备份重要数据 - [x] 备份数据库 - [x] 备份软件包列表 - [x] 创建LVM快照 - [x] 记录系统信息 2. 升级执行 2.1 升级前准备 - [ ] 通知用户和维护窗口 - [ ] 停止应用服务 - [ ] 验证备份完整性 - [ ] 准备回滚方案 2.2 执行升级 - [ ] 安装leapp工具 - [ ] 执行leapp preupgrade检查 - [ ] 修复leapp发现的问题 - [ ] 执行leapp upgrade - [ ] 重启系统 2.3 升级后验证 - [ ] 验证系统版本 - [ ] 验证内核版本 - [ ] 验证系统服务 - [ ] 验证网络连接 - [ ] 验证应用功能 - [ ] 验证数据完整性 3. 回滚计划 3.1 回滚触发条件 - 升级失败 - 系统无法启动 - 应用功能异常 - 数据损坏 3.2 回滚步骤 - [ ] 从LVM快照恢复 - [ ] 恢复系统配置 - [ ] 恢复重要数据 - [ ] 恢复数据库 - [ ] 验证系统功能 4. 时间安排 升级前准备: 1天 升级执行: 2-4小时 升级后验证: 1天 总计: 2天 5. 负责人 技术负责人: fgedu 执行人员: fgedu 审核人员: admin 6. 联系方式 技术支持: support@fgedu.net.cn 紧急联系: 13800138000
$ cat > /backup/upgrade-checklist.txt << 'EOF' RHEL 9 to RHEL 10 Upgrade Checklist ==================================== Phase 1: Pre-Upgrade Checks □ System version is RHEL 9.5 or higher □ Kernel version is compatible □ Disk space >= 10GB free
□ Memory >= 4GB
□ Network connection is stable
□ System services are running normally
□ SELinux is enabled
□ Firewall is configured
□ Third-party repositories are disabled
□ Custom kernel modules are removed
□ Deprecated packages are removed
□ Log files are cleaned
□ Backup is completed
□ Backup is verified
□ Rollback plan is prepared
Phase 2: Upgrade Execution
□ Users are notified
□ Maintenance window is scheduled
□ Application services are stopped
□ Backup is verified again
□ leapp tool is installed
□ leapp preupgrade is executed
□ leapp issues are fixed
□ leapp upgrade is executed
□ System is rebooted
□ System boots successfully
Phase 3: Post-Upgrade Verification
□ System version is RHEL 10
□ Kernel version is correct
□ System services are running
□ Network connection is working
□ Application services are started
□ Application functionality is verified
□ Data integrity is verified
□ Performance is acceptable
□ Logs are checked for errors
□ Backup is updated
Phase 4: Documentation
□ Upgrade process is documented
□ Issues encountered are recorded
□ Solutions are documented
□ Lessons learned are captured
□ Documentation is shared with team
EOF
$ cat /backup/upgrade-checklist.txt
RHEL 9 to RHEL 10 Upgrade Checklist
====================================
Phase 1: Pre-Upgrade Checks
□ System version is RHEL 9.5 or higher
□ Kernel version is compatible
□ Disk space >= 10GB free
□ Memory >= 4GB
□ Network connection is stable
□ System services are running normally
□ SELinux is enabled
□ Firewall is configured
□ Third-party repositories are disabled
□ Custom kernel modules are removed
□ Deprecated packages are removed
□ Log files are cleaned
□ Backup is completed
□ Backup is verified
□ Rollback plan is prepared
Phase 2: Upgrade Execution
□ Users are notified
□ Maintenance window is scheduled
□ Application services are stopped
□ Backup is verified again
□ leapp tool is installed
□ leapp preupgrade is executed
□ leapp issues are fixed
□ leapp upgrade is executed
□ System is rebooted
□ System boots successfully
Phase 3: Post-Upgrade Verification
□ System version is RHEL 10
□ Kernel version is correct
□ System services are running
□ Network connection is working
□ Application services are started
□ Application functionality is verified
□ Data integrity is verified
□ Performance is acceptable
□ Logs are checked for errors
□ Backup is updated
Phase 4: Documentation
□ Upgrade process is documented
□ Issues encountered are recorded
□ Solutions are documented
□ Lessons learned are captured
□ Documentation is shared with team
10. 风哥经验总结
在生产环境中进行RHEL9到RHEL10升级的经验总结。学习交流加群风哥微信: itpux-com
$ cat > /backup/experience1.txt << 'EOF' 经验1:充分的前期准备是升级成功的关键 1. 系统检查要全面 - 不要只依赖preupg工具 - 手动检查重要配置 - 验证所有依赖关系 2. 问题修复要彻底 - 不要跳过任何警告 - 高优先级问题必须修复 - 中等优先级问题尽量修复 3. 备份要完整 - 系统配置文件 - 重要数据 - 数据库 - 软件包列表 - 系统信息 4. 测试要充分 - 在测试环境先验证 - 验证升级流程 - 验证回滚流程 - 验证应用兼容性 EOF
$ cat > /backup/experience2.txt << 'EOF' 经验2:选择合适的升级时机 1. 避开业务高峰期 - 选择业务低峰期 - 安排充足的维护窗口 - 通知所有相关人员 2. 考虑节假日 - 避开重要节假日 - 避开月初月末 - 避开季度末年末 3. 准备应急预案 - 升级失败的处理方案 - 回滚流程 - 紧急联系方式 - 技术支持渠道 EOF
$ cat > /backup/experience3.txt << 'EOF' 经验3:升级过程要密切监控 1. 实时监控升级进度 - 关注升级日志 - 监控系统资源 - 检查错误信息 2. 及时处理问题 - 不要忽略任何错误 - 及时记录问题 - 快速寻找解决方案 3. 保持沟通 - 及时向相关人员汇报进度 - 遇到问题及时沟通 - 寻求技术支持 EOF
$ cat > /backup/experience4.txt << 'EOF' 经验4:升级后要全面验证 1. 系统功能验证 - 系统版本 - 内核版本 - 系统服务 - 网络连接 2. 应用功能验证 - 应用服务 - 应用功能 - 数据完整性 - 性能表现 3. 日志检查 - 系统日志 - 应用日志 - 错误日志 - 警告信息 EOF
本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html
