Chapter 4. Upgrading your system from RHEL 6 to RHEL 7 After you have corrected all problems reported by the Preupgrade Assistant, use the Red Hat Upgrade Tool to upgrade your system from RHEL 6.10 to RHEL 7.9. Always perform any necessary post-install tasks to ensure your system is up-to-date and to prevent upgrade-related problems. Important Test the upgrade process on a safe, non-production system before you perform it on any production system. Prerequisites You have completed the preparation steps described in Preparing a RHEL 6 system for the upgrade , including a full system backup. You have performed the pre-upgrade system assessment and resolved all reported problems. For details, see Assessing system upgrade suitability . Procedure Prepare source repositories or media with RHEL 7 packages in one of the following locations: An installation repository created from a DVD ISO where you download RHEL 7 packages, for example, an FTP server or an HTTPS site that contains the RHEL 7.9 packages. For more information, see Preparing installation sources . Mounted installation media An ISO image In any of the above options, you can configure custom repositories and additional repositories provided by Red Hat. For example, certain packages available in the RHEL 6 Base system are provided in the RHEL 7 Extras repository and are not on a RHEL 7 DVD. If you know that your system requires packages that are not in the RHEL 7 Base repository, you can install a separate RHEL 7 system to act as a yum repository that provides the required packages over FTP or HTTP. To set up an additional repository that you can use during the upgrade, follow instructions in How to create a local repository for updates . Then use the --addrepo=REPOID=URL option with the redhat-upgrade-tool command. Important It is strongly recommended to use RHEL 7.9 GA source repositories to prevent booting issues after the upgrade. For more information, see Known Issues . Disable active repositories to prevent problems with combining packages from different major releases of RHEL. Install the yum-utils package: Disable active repositories: For more information, see Can I install packages from different versions of RHEL . Run the Red Hat Upgrade Tool to download RHEL 7 packages and prepare the package installation. Specify the location of the Red Hat Enterprise Linux 7 packages: Installation repository Mounted installation media If you do not specify the device path, the Red Hat Upgrade Tool scans all mounted removable devices. ISO image Important You can use the following options with the redhat-upgrade-tool command for all three locations: --cleanup post: Automatically removes Red Hat-signed packages that do not have a RHEL 7 replacement. Recommended. If you do not use the --cleanup-post option, you must remove all remaining RHEL 6 packages after the in-place upgrade to ensure that your system is fully supported. --snapshot-root-lv and --snapshot-lv: Creates snapshots of system volumes. Snapshots are required to perform a rollback of the RHEL system in case of upgrade failure. For more information, see Rollbacks and cleanup after upgrading RHEL 6 to RHEL 7 . Reboot the system when prompted. Depending on the number of packages being upgraded, this process can take up to several hours to complete. Manually perform any post-upgrade tasks described in the pre-upgrade assessment result. If your system architecture is 64-bit Intel, upgrade from GRUB Legacy to GRUB 2. See the System Administrators Guide for more information. If Samba is installed on the upgraded host, manually run the testparm utility to verify the /etc/samba/smb.conf file. If the utility reports any configuration errors, you must fix them before you can start Samba. Optional: If you did not use the --cleanup-post option when running the Red Hat Upgrade Tool, clean up orphaned RHEL 6 packages: Warning Be careful not to accidentally remove custom packages that are compatible with RHEL 7. Warning Using the rpm command to remove orphaned packages might cause broken dependencies in some RHEL 7 packages. Refer to Fixing dependency errors for information about how to fix those dependency errors. Update your new RHEL 7 packages to their latest version. Verification Verify that the system was upgraded to the latest version of RHEL 7. Verify that the system is automatically resubscribed for RHEL 7. If the repository list does not contain RHEL repositories, run the following commands to unsubscribe the system, resubscribe the system as a RHEL 7 system, and add required repositories: If any problems occur during or after the in-place upgrade, see Troubleshooting for assistance.

Commands:
yum install yum-utils
yum-config-manager --disable \*
redhat-upgrade-tool --network 7.9 --instrepo ftp-or-http-url --cleanup-post
redhat-upgrade-tool --device device_path --cleanup-post
redhat-upgrade-tool --iso iso_path --cleanup-post
reboot
rpm -qa | grep .el6 &> /tmp/el6.txt rpm -e USD(cat /tmp/el6.txt) --nodeps
yum update reboot
cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.9 (Maipo)
yum repolist Loaded plugins: product-id, subscription-manager repo id repo name status rhel-7-server-rpms/7Server/x86_64 Red Hat Enterprise Linux 7 Server (RPMs) 23,676
subscription-manager remove --all subscription-manager unregister subscription-manager register subscription-manager attach --pool= poolID subscription-manager repos --enable= repoID