Upgrading CentOS from 7 to 8 is experimental, RedHat provides a separate tool for RHEL called leapp to upgrade from EL 7.6+ to 8,
1. Check the RedHat Subscription
subscription-manager list –installed
2. If not, run the following commands to automatically assign the subscription to the system and verify the subscription.
subscription-manager attach –auto
subscription-manager list –installed
3. Make sure Extended Update Support (EUS) repositories enabled.
subscription-manager repos –disable rhel-7-server-rpms –enable rhel-7-server-eus-rpms
subscription-manager repos –disable rhel-7-server-optional-rpms –enable rhel-7-server-eus-optional-rpms
4. Clear the version lock if any (yum-plugin-versionlock)
Yum versionlock clear
5. Set the Red Hat Subscription Manager to consume the RHEL 7.6 content
subscription-manager release –set 7.6
6. Update and Reboot
yum update ; reboot
7. Enable the Extras repository where some of the dependencies are available:
subscription-manager repos –enable rhel-7-server-extras-rpms
8. Install the Leapp utility
yum install leapp
9. On your RHEL 7 system, perform the pre-upgrade phase separately:
leapp preupgrade (Optional)
10. Start the upgrade Process
leapp upgrade
11. Reboot the system
reboot
12. Post-upgrade tasks
Enable Selinux if required – setenforce 1
start firewall if required – systemctl enable –now firewalld
Check the Redhat Release – cat /etc/redhat-release
Check the kernel version – uname -r
Check the Subscription – subscription-manager list –installed
Check the Release – subscription-manager release
Note: If you want to unset the release version to be able to consume updates from the latest minor version of RHEL 8, unset it – subscription-manager release –unset