Chapter 8. Performing post-upgrade tasks
The following major tasks are recommended after an in-place upgrade to RHEL 8.
Prerequisites
- You have upgraded the system following the steps described in Performing the upgrade from RHEL 7 to RHEL 8 and you have been able to log in to RHEL 8.
- You have verified the status of the in-place upgrade following the steps described in Verifying the post-upgrade status of the RHEL 8 system.
Procedure
After performing the upgrade, complete the following tasks:
Remove any remaining
Leapppackages from the exclude list in the/etc/dnf/dnf.confconfiguration file, including thesnactorpackage. During the in-place upgrade,Leapppackages that were installed with theLeapputility are automatically added to the exclude list to prevent critical files from being removed or updated. After the in-place upgrade, you must remove theseLeapppackages from the exclude list before they can be removed from the system.-
To manually remove packages from the exclude list, edit the
/etc/dnf/dnf.confconfiguration file and remove the desiredLeapppackages from theexcludelist. To remove all packages from the
excludelist:yum config-manager --save --setopt exclude=''
# yum config-manager --save --setopt exclude=''Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
To manually remove packages from the exclude list, edit the
Remove remaining RHEL 7 packages, including remaining
Leapppackages.Determine old kernel versions:
cd /lib/modules && ls -d *.el7*
# cd /lib/modules && ls -d *.el7*Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove weak modules from the old kernel. If you have multiple old kernels, repeat the following step for each kernel:
[ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel <version>
# [ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel <version>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace <version> with the kernel version determined in the previous step, for example:
[ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel 3.10.0-1160.25.1.el7.x86_64
# [ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel 3.10.0-1160.25.1.el7.x86_64Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIgnore the following error message, which is generated if the kernel package has been previously removed:
/usr/sbin/weak-modules: line 1081: cd: /lib/modules/<version>/weak-updates: No such file or directory
/usr/sbin/weak-modules: line 1081: cd: /lib/modules/<version>/weak-updates: No such file or directoryCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove the old kernel from the boot loader entry. If you have multiple old kernels, repeat this step for each kernel:
/bin/kernel-install remove <version> /lib/modules/<version>/vmlinuz
# /bin/kernel-install remove <version> /lib/modules/<version>/vmlinuzCopy to Clipboard Copied! Toggle word wrap Toggle overflow Replace version with the kernel version determined in the previous step, for example:
/bin/kernel-install remove 3.10.0-1160.25.1.el7.x86_64 /lib/modules/3.10.0-1160.25.1.el7.x86_64/vmlinuz
# /bin/kernel-install remove 3.10.0-1160.25.1.el7.x86_64 /lib/modules/3.10.0-1160.25.1.el7.x86_64/vmlinuzCopy to Clipboard Copied! Toggle word wrap Toggle overflow Locate remaining RHEL 7 packages:
rpm -qa | grep -e '\.el[67]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort
# rpm -qa | grep -e '\.el[67]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sortCopy to Clipboard Copied! Toggle word wrap Toggle overflow Remove remaining RHEL 7 packages, including old kernel packages, and the
kernel-workaroundpackage from your RHEL 8 system. To ensure that RPM dependencies are maintained, useYUMorDNFwhen performing these actions. Review the transaction before accepting to ensure no packages are unintentionally removed.For example:
yum remove kernel-workaround $(rpm -qa | grep \.el7 | grep -vE 'gpg-pubkey|libmodulemd|katello-ca-consumer')
# yum remove kernel-workaround $(rpm -qa | grep \.el7 | grep -vE 'gpg-pubkey|libmodulemd|katello-ca-consumer')Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove remaining
Leappdependency packages:yum remove leapp-deps-el8 leapp-repository-deps-el8
# yum remove leapp-deps-el8 leapp-repository-deps-el8Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove any remaining obsolete directories:
rm -r /lib/modules/*el7*
# rm -r /lib/modules/*el7*Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you used RHEL 7 ELS billing through the host metering agent, remove the ELS certificate:
rm -f /etc/pki/product/204.pem
# rm -f /etc/pki/product/204.pemCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: Remove all remaining upgrade-related data from the system:
rm -rf /var/log/leapp /root/tmp_leapp_py3 /var/lib/leapp
# rm -rf /var/log/leapp /root/tmp_leapp_py3 /var/lib/leappCopy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantRemoving this data might limit Red Hat Support’s ability to investigate and troubleshoot post-upgrade problems.
Disable YUM repositories whose packages cannot be installed or used on RHEL 8. Repositories managed by RHSM are handled automatically. To disable these repositories:
yum config-manager --set-disabled <repository_id>
# yum config-manager --set-disabled <repository_id>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Replace <repository_id> with the repository ID.
Replace the old rescue kernel and initial RAM disk with the current kernel and disk:
Remove the existing rescue kernel and initial RAM disk:
rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue*
# rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue*Copy to Clipboard Copied! Toggle word wrap Toggle overflow Reinstall the rescue kernel and related initial RAM disk:
/usr/lib/kernel/install.d/51-dracut-rescue.install add "$(uname -r)" /boot "/boot/vmlinuz-$(uname -r)"
# /usr/lib/kernel/install.d/51-dracut-rescue.install add "$(uname -r)" /boot "/boot/vmlinuz-$(uname -r)"Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf your system’s kernel package has a different name, such as on real-time systems, replace
kernel-corewith the correct package name.If your system is on the IBM Z architecture, update the
ziplboot loader:zipl
# ziplCopy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Optional: Review, remediate, and then remove the
rpmnew,rpmsave, andleappsavefiles. Note thatrpmsaveandleappsaveare equivalent and can be handled similarly. For more information, see What are rpmnew & rpmsave files? - Re-evaluate and re-apply your security policies. Especially, change the SELinux mode to enforcing. For details, see Applying security policies.
Verification
Verify that the old kernels have been removed from the boot loader entry:
grubby --info=ALL | grep "\.el7" || echo "Old kernels are not present in the boot loader."
# grubby --info=ALL | grep "\.el7" || echo "Old kernels are not present in the boot loader."Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the previously removed rescue kernel and rescue initial RAM disk files have been created for the current kernel:
ls /boot/vmlinuz-*rescue* /boot/initramfs-*rescue* lsinitrd /boot/initramfs-*rescue*.img | grep -qm1 "$(uname -r)/kernel/" && echo "OK" || echo "FAIL"
# ls /boot/vmlinuz-*rescue* /boot/initramfs-*rescue* # lsinitrd /boot/initramfs-*rescue*.img | grep -qm1 "$(uname -r)/kernel/" && echo "OK" || echo "FAIL"Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the rescue boot entry refers to the existing rescue files. See the grubby output:
grubby --info $(ls /boot/vmlinuz-*rescue*)
# grubby --info $(ls /boot/vmlinuz-*rescue*)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that you have removed all RHEL 7 packages:
rpm -qa | grep -e '\.el[67]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort
# rpm -qa | grep -e '\.el[67]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sortCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteThis command might also list third-party packages.
If you used RHEL 7 ELS billing through the host metering agent, verify that ELS add-on is not longer installed and the related certificate is not present on the system:
subscription-manager list --installed ls /etc/pki/product/204.pem && echo "The ELS certificate is still present."
# subscription-manager list --installed # ls /etc/pki/product/204.pem && echo "The ELS certificate is still present."Copy to Clipboard Copied! Toggle word wrap Toggle overflow If any installed products have an engineering product ID of
204or the certificate is present, then ELS might be still active on the system and you might continue to be billed.