You are currently viewing How to Upgrade CentOS 7 to CentOS 8
linux server

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

Leave a Reply