Upgrading from RHEL 7 to RHEL 8 Red Hat Enterprise Linux 8 Instructions for an in-place upgrade from Red Hat Enterprise Linux 7 to Red Hat Enterprise Linux 8 Red Hat Customer Content Services

Commands:
subscription-manager status +-------------------------------------------+ System Status Details +-------------------------------------------+ Overall Status: Disabled Content Access Mode is set to Simple Content Access. This host has access to content, regardless of subscription status. System Purpose Status: Disabled
subscription-manager list --installed +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux Server Product ID: 69 Version: 7.9 Arch: x86_64 Status: Subscribed
subscription-manager repos --enable rhel-7-server-rpms
subscription-manager repos --enable rhel-7-server-extras-rpms
subscription-manager release --unset
yum versionlock clear
yum-config-manager --enable rhui-client-config-server-7 yum-config-manager --enable rhel-7-server-rhui-extras-rpms yum -y install rh-amazon-rhui-client leapp-rhui-aws
yum-config-manager --enable rhui-microsoft-azure-rhel7 yum -y install rhui-azure-rhel7 yum-config-manager --enable rhui-rhel-7-server-rhui-extras-rpms yum -y install leapp-rhui-azure
yum install leapp-upgrade
yum update reboot
hammer repository list --search 'content_label ~ rhel-7' --content-view <content_view_name> --organization <organization> --lifecycle-environment <lifecycle_environment> hammer repository list --search 'content_label ~ rhel-8' --content-view <content_view_name> --organization <organization> --lifecycle-environment <lifecycle_environment>
subscription-manager repos --list-enabled | grep "^Repo ID" Repo ID: rhel-7-server-extras-rpms Repo ID: rhel-7-server-rpm
leapp preupgrade --target <target_os_version>
leapp preupgrade --enablerepo <repository_id1> --enablerepo <repository_id2>
leapp answer --section <question_section> . <field_name> = <answer>
leapp answer --section remove_pam_pkcs11_module_check.confirm=False
dnf install cockpit-leapp
leapp preupgrade --target <target_os_version>
leapp preupgrade --enablerepo <repository_id1> --enablerepo <repository_id2>
leapp answer --section <question_section> . <field_name> = <answer>
leapp answer --section remove_pam_pkcs11_module_check.confirm=False
leapp upgrade --target <target_os_version>
leapp upgrade --enablerepo <repository_id1> --enablerepo <repository_id2> ...
reboot
cat /etc/redhat-release Red Hat Enterprise Linux release <target_os_version> (Ootpa)
uname -r 4.18.0-305.el <target_os> .x86_64
subscription-manager list --installed +-----------------------------------------+ Installed Product Status +-----------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Product ID: 479 Version: <target_os_version> Arch: x86_64 Status: Subscribed
subscription-manager release Release: <target_os_version>
yum config-manager --save --setopt exclude=''
cd /lib/modules && ls -d *.el7*
[ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel <version>
[ -x /usr/sbin/weak-modules ] && /usr/sbin/weak-modules --remove-kernel 3.10.0-1160.25.1.el7.x86_64
/usr/sbin/weak-modules: line 1081: cd: /lib/modules/ <version> /weak-updates: No such file or directory
/bin/kernel-install remove <version> /lib/modules/ <version> /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/vmlinuz
rpm -qa | grep -e '\.el[67]' | grep -vE '^(gpg-pubkey|libmodulemd|katello-ca-consumer)' | sort
yum remove kernel-workaround USD(rpm -qa | grep \.el7 | grep -vE 'gpg-pubkey|libmodulemd|katello-ca-consumer')
yum remove leapp-deps-el8 leapp-repository-deps-el8
rm -r /lib/modules/*el7*
rm -rf /var/log/leapp /root/tmp_leapp_py3 /var/lib/leapp
yum config-manager --set-disabled <repository_id>
rm /boot/vmlinuz-*rescue* /boot/initramfs-*rescue*
/usr/lib/kernel/install.d/51-dracut-rescue.install add "USD(uname -r)" /boot "/boot/vmlinuz-USD(uname -r)"
zipl
grubby --info=ALL | grep "\.el7" || echo "Old kernels are not present in the boot loader."
ls /boot/vmlinuz-*rescue* /boot/initramfs-*rescue* lsinitrd /boot/initramfs-*rescue*.img | grep -qm1 "USD(uname -r)/kernel/" && echo "OK" || echo "FAIL"
grubby --info USD(ls /boot/vmlinuz-*rescue*)
ausearch -m AVC,USER_AVC -ts boot
vi /etc/selinux/config
This file controls the state of SELinux on the system. SELINUX= can take one of these three values: enforcing - SELinux security policy is enforced. permissive - SELinux prints warnings instead of enforcing. disabled - No SELinux policy is loaded. SELINUX= enforcing SELINUXTYPE= can take one of these two values: targeted - Targeted processes are protected, mls - Multi Level Security protection. SELINUXTYPE=targeted
reboot
getenforce Enforcing
update-crypto-policies --show DEFAULT
update-crypto-policies --set FUTURE Setting system policy to FUTURE
ls /usr/share/xml/scap/ssg/content/ ssg-firefox-cpe-dictionary.xml ssg-rhel6-ocil.xml ssg-firefox-cpe-oval.xml ssg-rhel6-oval.xml ssg-rhel6-ds-1.2.xml ssg-rhel8-oval.xml ssg-rhel8-ds.xml ssg-rhel8-xccdf.xml
oscap xccdf eval --profile pci-dss --remediate /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
reboot
oscap xccdf eval --report pcidss_report.html --profile pci-dss /usr/share/xml/scap/ssg/content/ssg-rhel8-ds.xml
Title: None Reason: Confirmation =================== remove_pam_pkcs11_module_check.confirm ================== Label: Disable pam_pkcs11 module in PAM configuration? If no, the upgrade process will be interrupted. Description: PAM module pam_pkcs11 is no longer available in RHEL-8 since it was replaced by SSSD. Type: bool Default: None Available choices: True/False Unanswered question. Uncomment the following line with your answer confirm =
[remove_pam_pkcs11_module_check] Available choices: True/False Unanswered question. Uncomment the following line with your answer confirm = True
journalctl
ausearch -m AVC,USER_AVC -ts boot journalctl -t setroubleshoot dmesg | grep -i -e selinux -e type=1400
upgrade[469]: STDERR: upgrade[469]: Error in PREIN scriptlet in rpm package unbound-libs upgrade[469]: Error: Transaction failed upgrade[469]: Container el8userspace failed with error code 1. unbound-libs has a PREIN failure
OperationalError: unable to open database file Cannot create XFS filesystem in
mount -o remount --make-shared <mountpoint>
echo brotli >> /etc/leapp/transaction/to_install
grubby --update-kernel=ALL --args 'net.ifnames=0'
zipl
sosreport