《OpenShift / RHEL / DevSecOps 汇总目录》
说明
本文的环境可来自以下任意一个已升级到 RHEL 7.9 的环境(当然还可以是用户自己安装的 RHEL 7.9 环境):
- 《在离线环境中将 CentOS 7.x 原地升级并迁移至 RHEL 7.9》或 《一步将 CentOS 7.x 原地升级并迁移至 RHEL 7.9》的结果,即从已经从 CentOS 7.5 升级到 RHEL 7.9 的环境。
- 《两步将 CentOS 6.0 原地升级并迁移至 RHEL 7.9》的结果,即从已经从 CentOS 6.0 升级到 RHEL 7.9 的环境。
注意:上述两种 RHEL 7.9 的环境在升级到 RHEL 8.10 的操作有稍许区别,下文会介绍到。
RHEL 大版本升级方法
在对 RHEL 进行大版本升级的时候有两种方法:原地升级和全新安装新。其中 RHEL 原地升级只能在相邻两个版本之间进行,而不能跨大版本进行,例如从 RHEL 7 升级到 RHEL 8。另外,对 RHEL 7 进行原地升级必须是 RHEL 7.9,而 RHEL 8 的小版本可以在升级中指定。
RHEL 原地升级的过程如下:
- 首先对现有 RHEL 环境进行分析,发现升级风险。为了能执行升级,至少需要修复发现的 Error 和 Inhibitor 项目。
- 进行正式升级。升级过程系统会重启,第一次手工重启,第二次自动重启。
从 RHEL 7.9 到 RHEL 8.10 原地升级
对于从 RHEL 6 升级过来的 RHEL 7.9 系统
注意:本节内容只适用于从 RHEL 6 升级或从 CentOS 6 迁移过来的 RHEL 7.9 系统,而不适用于从 RHEL 7.x 更新或 CentOS 7.x 迁移过来的 RHEL 7.9 系统。
将 GRUB Legacy 升级到 GRUB 2
从 RHEL 6 升级或从 CentOS 6 迁移过来的 RHEL 7.9 系统还会沿用 GRUB Legacy 引导系统。虽然 GRUB Legacy 在 RHEL 7 中还被支持,但是在 RHEL 8 中就完全不支持了,因此需要使用 GRUB 2 替换 GRUB Legacy。
注意:以下以通过 BIOS 方式启动的 VM 为例,如果系统是通过 EFI 方式启动的,配置方法可参见 “红帽官方文档”。
说明:可以使用 df -h
命令查看系统中是否存在 /boot/efi 挂载点,如果存在,则说明系统是通过 EFI 引导的;如果不存在,则说明系统是通过 BIOS 引导的。
安装 GRUB 2
- 删除 GRUB Legacy 软件包,然后使用 RHEL 7.9 Yum Repo 安装 GRUB 2 软件包。
$ yum remove grub -y
$ yum install grub2 -y
生成 GRUB 2 配置文件
- 查看系统的 lv,vg 和 磁盘设备 sda。
$ lvm lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_home vg_c2rdemo -wi-ao---- <36.65g
lv_root vg_c2rdemo -wi-ao---- <37.91g
lv_swap vg_c2rdemo -wi-ao---- 4.95g
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 80G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 79.5G 0 part
├─vg_c2rdemo-lv_root 253:0 0 37.9G 0 lvm /
├─vg_c2rdemo-lv_swap 253:1 0 5G 0 lvm [SWAP]
└─vg_c2rdemo-lv_home 253:2 0 36.7G 0 lvm /home
sr0 11:0 1 3.6G 0 rom
sr1 11:1 1 4.2G 0 rom
- 创建
/etc/default/grub
文件,以下是内容模板。需要用上一步查到的 lv 和 vg 替换GRUB_CMDLINE_LINUX
后的内容。
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=vg_c2rdemo/lv_home rd.lvm.lv=vg_c2rdemo/lv_root rd.lvm.lv=vg_c2rdemo/lv_swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
- 确认
/etc/default/grub
文件是以下访问选前权限和用户属主
$ ll /etc/default/grub
-rw-r--r--. 1 root root 339 May 29 00:03 /etc/default/grub
- 生成
/boot/grub2/grub.cfg
文件。
$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-1160.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1160.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-a13726bf5edeb893b54edd9b0000000e
Found initrd image: /boot/initramfs-0-rescue-a13726bf5edeb893b54edd9b0000000e.img
done
用 GRUB 2 替换 GRUB Legacy 引导加载程序
- 向系统安装 GRUB 2 环境
$ grub2-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
- 删除 GRUB Legacy 配置,然后重启系统。
$ rm /boot/grub/grub.conf -f
$ reboot
其他可能需要的手动调整
对于从 RHEL 6 升级过来的 RHEL 7.9 系统,在本文 “从 RHEL 7.9 向 RHEL 8.10 升级系统” 一节的预升级或正式升级的时候可能还会提示以下几类错误,到时候可以根据需要进行对应的调整。
去掉 RHEL 8 不再支持的 btrfs 文件系统模块
去掉 RHEL 8 不再支持的 btrfs 文件系统模块
$ modprobe -r btrfs
修改 RHEL 8 不再支持的网卡命名
RHEL 8 不再支持的 eth0、eth1 这样的网卡命名。编辑所有网卡对应的文件,例如 /etc/sysconfig/network-scripts/ifcfg-eth0
,将 DEVICE="eth0"
改为 DEVICE="net0"
。
删除引起冲去的残存 RHEL 6 RPM 包
- 如果有以下错误提示:
Stderr: No matches found for the following disable plugin patterns: subscription-manager
Warning: Package marked by Leapp to install not found in repositories metadata: python3-nss cups-browsed cups-filters-driverless
Warning: Package marked by Leapp to upgrade not found in repositories metadata: gpg-pubkey leapp-upgrade-el7toel8 leapp python2-leapp
Error: transaction check vs depsolve:
xz = 4.999.9-0.5.beta.20091007git.el6 is needed by (installed) xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64
plymouth-plugin-two-step = 0.8.3-29.el6 is needed by (installed) plymouth-theme-rings-0.8.3-29.el6.noarch
python(abi) = 2.6 is needed by (installed) python-crypto-2.0.1-22.el6.x86_64
python(abi) = 2.6 is needed by (installed) pyxf86config-0.3.37-7.1.el6.x86_64
python(abi) = 2.6 is needed by (installed) python-iwlib-0.1-1.2.el6.x86_64
python(abi) = 2.6 is needed by (installed) python-argparse-1.2.1-2.1.el6.noarch
To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.
You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue.
Hint: If there was a problem reaching remote content (see stderr output) and proxy is configured in the YUM/DNF configuration file, the proxy configuration is likely causing this error. Make sure the proxy is properly configured in /etc/dnf/dnf.conf. It's also possible the proxy settings in the DNF configuration file are incompatible with the target system. A compatible configuration can be placed in /etc/leapp/files/dnf.conf which, if present, it will be used during some parts of the upgrade instead of original /etc/dnf/dnf.conf. In such case the configuration will also be applied to the target system. Note that /etc/dnf/dnf.conf needs to be still configured correctly for your current system to pass the early phases of the upgrade process.
可以执行以下命令删除引起冲突的残存 RHEL 6 RPM 包。
$ yum erase xz-lzma-compat-4.999.9-0.5.beta.20091007git.el6.x86_64 \
plymouth-theme-rings-0.8.3-29.el6.noarch \
pyxf86config-0.3.37-7.1.el6.x86_64 \
python-crypto-2.0.1-22.el6.x86_64 \
python-iwlib-0.1-1.2.el6.x86_64 \
python-argparse-1.2.1-2.1.el6.noarch
- 如果有以下错误提示:
Error: Transaction test error:
file /usr/lib/firmware/ql2400_fw.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package ql2400-firmware-7.03.00-1.el6.noarch
file /usr/lib/firmware/ql2500_fw.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package ql2500-firmware-7.03.00-1.el6.noarch
file /usr/lib/firmware/radeon/BONAIRE_uvd.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_ce.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_me.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_mec.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_pfp.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_rlc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_sdma.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/bonaire_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hainan_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_ce.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_mc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_me.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_mec.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_pfp.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_rlc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_sdma.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/hawaii_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kabini_ce.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kabini_me.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kabini_mec.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kabini_pfp.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kabini_sdma.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_ce.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_me.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_mec.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_mec2.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_pfp.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_rlc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/kaveri_sdma.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/mullins_ce.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/mullins_me.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/mullins_mec.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/mullins_pfp.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/mullins_sdma.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/oland_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/pitcairn_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/tahiti_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/lib/firmware/radeon/verde_smc.bin from install of linux-firmware-20240111-121.gitb3132c18.el8.noarch conflicts with file from package xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch
file /usr/bin/eqn from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/groff from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/grops from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/grotty from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/neqn from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/nroff from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/pic from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/post-grohtml from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/pre-grohtml from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/soelim from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/tbl from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/bin/troff from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/eqn.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/groff.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/grops.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/grotty.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/neqn.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/nroff.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/pic.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/soelim.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/tbl.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
file /usr/share/man/man1/troff.1.gz from install of groff-base-1.22.3-18.el8.x86_64 conflicts with file from package groff-1.18.1.4-21.el6.x86_64
Hint: If there was a problem reaching remote content (see stderr output) and proxy is configured in the YUM/DNF configuration file, the proxy configuration is likely causing this error. Make sure the proxy is properly configured in /etc/dnf/dnf.conf. It's also possible the proxy settings in the DNF configuration file are incompatible with the target system. A compatible configuration can be placed in /etc/leapp/files/dnf.conf which, if present, it will be used during some parts of the upgrade instead of original /etc/dnf/dnf.conf. In such case the configuration will also be applied to the target system. Note that /etc/dnf/dnf.conf needs to be still configured correctly for your current system to pass the early phases of the upgrade process.
可以执行以下命令删除引起冲突的残存 RHEL 6 RPM 包。
$ yum erase ql2400-firmware-7.03.00-1.el6.noarch \
ql2500-firmware-7.03.00-1.el6.noarch \
xorg-x11-drv-ati-firmware-7.6.1-4.el6.noarch \
groff-1.18.1.4-21.el6.x86_64
安装升级程序 leapp
从 RHEL 7 向 RHEL 8 原地升级需要先安装 leapp 程序。
- 确认当前可用的 Yum Repo 只有 rhel7-local-repo。
$ yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
rhel7-local-repo rhel7 local repo 5,230
repolist: 5,230
- 在可上网区从 https://access.redhat.com/downloads/content/69/ver=/rhel—7/7.9/x86_64/packages 找到以下文件并下载。注意:python2-hawkey 会有多个版本,需下载版本高的文件(python2-hawkey-0.22.5-2.el7_9.x86_64.rpm)。
audit
audit-libs
audit-libs-python
checkpolicy
dnf
dnf-data
json-glib
leapp
leapp-deps
leapp-upgrade-el7toel8
leapp-upgrade-el7toel8-deps
libcgroup
libcomps
libdnf
libmodulemd
librepo
libreport-filesystem
librhsm
libsemanage-python
libsolv
libyaml
pciutils
policycoreutils
policycoreutils-python
python-IPy
python-chardet
python-enum34
python-requests
python-urllib3
python2-dnf
python2-hawkey
python2-leapp
python2-libcomps
python2-libdnf
setools-libs
- 将上面的 rpm 文件复制到离线的 RHEL 7.9 中,然后安装。
$ yum localinstall *.rpm
准备 RHEL 升级目标版本的 ISO
- 在可上网区从 https://developers.redhat.com/content-gateway/file/rhel/Red_Hat_Enterprise_Linux_8.10.0/rhel-8.10-x86_64-dvd.iso 下载 rhel-8.10-x86_64-dvd.iso 文件。
- 将 rhel-8.10-x86_64-dvd.iso 文件复制到 RHEL 7.9 离线环境中。
$ scp rhel-8.10-x86_64-dvd.iso root@<RHEL79-IP>:/root/
从 RHEL 7.9 向 RHEL 8.10 升级系统
预升级
- 执行以下命令进行预升级。
$ leapp preupgrade --no-rhsm --target 8.10 --iso ~/rhel-8.10-x86_64-dvd.iso
- 查看预升级的运行报告。至少必须解决 Errors 和 Inhibitors 的项目才可进行正式升级操作。
。。。
============================================================
REPORT OVERVIEW
============================================================
Upgrade has been inhibited due to the following problems:
1. Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
2. Missing required answers in the answer file
HIGH and MEDIUM severity reports:
1. Packages available in excluded repositories will not be installed
2. GRUB2 core will be automatically updated during the upgrade
3. Packages not signed by Red Hat found on the system
4. Difference in Python versions and support in RHEL 8
5. Leapp detected loaded kernel drivers which are no longer maintained in RHEL 8.
6. chrony using default configuration
Reports summary:
Errors: 0
Inhibitors: 2
HIGH severity reports: 5
MEDIUM severity reports: 1
LOW severity reports: 5
INFO severity reports: 4
Before continuing consult the full report:
A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt
============================================================
END OF REPORT OVERVIEW
============================================================
Answerfile has been generated at /var/log/leapp/answerfile
- 以上报告中有 2 个 Inhibitor 项目,查看运行报告文件 leapp-report.txt。
$ more /var/log/leapp/leapp-report.txt
Risk Factor: high (inhibitor)
Title: Leapp detected loaded kernel drivers which have been removed in RHEL 8. Upgrade cannot proceed.
Summary: Support for the following RHEL 7 device drivers has been removed in RHEL 8:
- pata_acpi
Key: f08a07da902958defa4f5c2699fae9ec2eb67c5b
----------------------------------------
Risk Factor: high (inhibitor)
Title: Missing required answers in the answer file
Summary: One or more sections in answerfile are missing user choices: remove_pam_pkcs11_module_check.confirm
For more information consult https://red.ht/leapp-dialogs.
Remediation: [hint] Please register user choices with leapp answer cli command or by manually editing the answerfile.
[command] leapp answer --section remove_pam_pkcs11_module_check.confirm=True
Key: d35f6c6b1b1fa6924ef442e3670d90fa92f0d54b
。。。
。。。
- 根据 leapp-report.txt 的说明修复 2 个 inhibitor 问题。
$ rmmod pata_acpi
$ leapp answer --section remove_pam_pkcs11_module_check.confirm=True
$ more /var/log/leapp/answerfile
[remove_pam_pkcs11_module_check]
confirm = True
- 再次运行预升级,确认此次已无 Errors 和 Inhibitors 项目。
$ leapp preupgrade --no-rhsm --target 8.10 --iso ~/rhel-8.10-x86_64-dvd.iso
。。。
============================================================
REPORT OVERVIEW
============================================================
HIGH and MEDIUM severity reports:
1. Packages available in excluded repositories will not be installed
2. Difference in Python versions and support in RHEL 8
3. Leapp detected loaded kernel drivers which are no longer maintained in RHEL 8.
4. GRUB2 core will be automatically updated during the upgrade
5. Packages not signed by Red Hat found on the system
6. Module pam_pkcs11 will be removed from PAM configuration
7. chrony using default configuration
Reports summary:
Errors: 0
Inhibitors: 0
HIGH severity reports: 5
MEDIUM severity reports: 2
LOW severity reports: 5
INFO severity reports: 4
Before continuing consult the full report:
A report has been generated at /var/log/leapp/leapp-report.json
A report has been generated at /var/log/leapp/leapp-report.txt
============================================================
END OF REPORT OVERVIEW
============================================================
正式升级
- 执行命令正式对 RHEL 7.9 进行升级。
$ leapp upgrade --no-rhsm --target 8.10 --iso ~/rhel-8.10-x86_64-dvd.iso
- 执行成功后会提示重启系统。
。。。
Transaction Summary
=================================================================================================================
Install 382 Packages
Upgrade 541 Packages
Remove 81 Packages
Downgrade 7 Packages
Total size: 966 M
DNF will only download packages, install gpg keys, and check the transaction.
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Complete!
====> * add_upgrade_boot_entry
Add new boot entry for Leapp provided initramfs.
A reboot is required to continue. Please reboot your system.
Debug output written to /var/log/leapp/leapp-upgrade.log
。。。
-
重启系统,然后选择 RHEL-Upgrade-Inittramfs 启动项。
-
查看系统升级进度。
-
升级过程完成后会自动重启系统,重启后最后显示下图。
验证
- 再次登录操作系统,然后查看升级后的产品版本和 Kernel 版本。
$ cat /etc/redhat-release
Red Hat Enterprise Linux release 8.10 (Ootpa)
$ uname -r
4.18.0-544.10.1.el8_8.x86_64
mysql(mariadb)
- 由于 mysql 已经从 5.5.68 升级到 10.3.39,执行以下操作后启动 mariadb 服务。
$ rm -f /var/lib/mysql/aria_log*
$ rm -f /var/lib/mysql/ib_log*
$ rm -f /var/lib/mysql/ibdata1
$ systemctl enable --now mariadb
- 参照《在离线环境中将 CentOS 7.5 原地升级并迁移至 RHEL 7.9》验证 mysql。
postgresql
- 由于 postgresql 已经从 9.2.24 升级到 10.3.39,因此需要像《两步将 CentOS 6.0 原地迁移至 RHEL 7.9》一文升级数据库。
$ yum install https://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/postgresql-upgrade-9.2.24-4.el7_8.x86_64.rpm
$ postgresql-setup --upgrade
$ systemctl enable --now postgresql
- 参照《在离线环境中将 CentOS 7.5 原地升级并迁移至 RHEL 7.9》验证 postgresql。
其他
参照《在离线环境中将运行 Oracle DB 12c 的 CentOS 7.5 原地升级并迁移至 RHEL 7.9》验证 Oracle DB。
参照《在离线环境中将 CentOS 7.5 原地升级并迁移至 RHEL 7.9》验证多种常用软件。
参照《两步将 CentOS 6.0 原地升级并迁移至 RHEL 7.9》验证 Tomcat 和 WebLogic 软件。
视频
别急,稍后录
参考
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/upgrading_from_rhel_7_to_rhel_8
https://access.redhat.com/solutions/6525931
https://access.redhat.com/articles/7013172
https://aap2.demoredhat.com/decks/ansible_ripu.pdf
https://access.redhat.com/solutions/4976981
https://access.redhat.com/solutions/2643721