How to Upgrade CentOS 7 to CentOS 8

Technology is upgrading rapidly, and this change leads to new updates. CentOS is a great operating system that provides regular updates. That’s why many users look for ways to upgrade their systems accordingly. So if you are one of them and want to upgrade CentOS 7 to CentOS 8, then you are at the right place. This article will guide you through step-by-step process to successfully upgrade to CentOS 8.

How to Upgrade CentOS 7 to CentOS 8

Open the terminal and run the following command to install the EPEL repository:

$ yum install epel-release -y

Now, the next step is to install the yum-util tools by running:

$ yum install yum-utils

Execute the following command to resolve the RPM packages :

$ yum install rpmconf

$ rpmconf -a

Then, clear all packages that aren’t required:

$ package-cleanup --leaves

$ package-cleanup --orphans

CentOS uses dnf package manager as the default package manager. To install it, we use this command:

$ yum install dnf

Removing the yum package manager:

$ dnf -y remove yum yum-metadata-parser

$ rm -Rf /etc/yum

Upgrade CentOS 7 to CentOS 8 Using Package Manager

Upgrade the system with the dnf package manager:

$ dnf upgrade

Now, use the dnf to install the CentOS release package :

$ dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-2.el8.noarch.rpm,centos-linux-release-8.4-1.2105.el8.noarch.rpm,centos-gpg-keys-8-2.el8.noarch.rpm}

Next, upgrade the installed EPEL repository:

$ dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Remove all the temporary files:

$ dnf clean all

Removing the old kernel from CentOS 7: Then, remove the conflicting packages :

$ rpm -e `rpm -q kernel`

$ rpm -e --nodeps sysvinit-tools

Next , run the upgrade for CentOS 8:

$ dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

Your system needs a kernel now, so install it executing this command:

$ dnf -y install kernel-core

Also, install CentOS minimal package:

$ dnf -y groupupdate "Core" "Minimal Install"

To confirm the current version, run this command :

$ cat /etc/redhat-release


Upgrading CentOS 7 to CentOS 8 can be a great option if you want to give a new touch to your system. CentOS 8 offers the latest features and options, so CentOS 8 is worth upgrading. We hope this article can provide valuable information on updating to CentOS 8. For more tutorials and guides, follow our website.

About the author

Ankit Sharma