For those who seek help in different areas of software and hardware platform.

How To Upgrade CentOS/RHEL 7 to CentOS/RHEL 8 using DNF Package Manager

This guide will show you how to upgrade from CentOS/RHEL 7 to CentOS/RHEL 8 using the dnf package manager. We always recommend performing these kind of task in staging before going into production.


You will need one CentOS 7 server with root privileges.

Installing EPEL Repository

yum -y install
yum -y install rpmconf yum-utils

rpmconf -a
package-cleanup --leaves
package-cleanup --orphans

Installing DNF Package Manager

yum -y install dnf
dnf -y remove yum yum-metadata-parser
rm -Rf /etc/yum

dnf -y upgrade
dnf -y upgrade
dnf -y upgrade
dnf clean all

rpm -e `rpm -q kernel`
rpm -e --nodeps sysvinit-tools

Upgrading to CentOS 8

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

rpmconf -a
rpm -e kernel-core

dnf -y install kernel-core
Verify that grub is updated and in the right location:
ROOTDEV=`ls /dev/*da|head -1`;
echo "Detected root as $ROOTDEV..."
grub2-install $ROOTDEV

Installing Minimal Package:

dnf -y groupupdate "Core" "Minimal Install"

Verify CentOS version:

cat /etc/centos-release


Wrapping up

You have successfully upgraded from CentOS 7 to CentOS 8 using dnf package manager and you now have a latest release of CentOS 8.


Post a Comment

Comments with links will not be published.

Video Tutorials