How to Upgrade Centos 7 to 8

CentOS 8 has been released on Sep 23rd, 2019 ISO’s are available on the official website and could be installed in many ways, unfortunately, the minimal version is not available yet (or at all) as a SysAdmin it was my favorite build about 800 Mb compared to 6 Go, in this tutorial I will show you how to upgrade from Centos 7 to Centos 8

Please consider that this is not an official upgrade so it’s not suitable for a production environment.

CentOS 7 to 8 Upgrade

Download and install EPEL repository:

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install yum-utils:

yum -y install rpmconf yum-utils

Resolving rpm packages:

rpmconf -a

result:

Result of rpmconf command

Keep Default.

Cleanup packages we don’t need.

package-cleanup --leaves
package-cleanup --orphans

result:

Package cleanup

Install an RPM-based software DNF package manager :

yum -y install dnf

 

Removing yum package manager:

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

Updating a system with DNF:

sudo dnf -y upgrade

Installing the new version:

dnf -y upgrade http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm

Upgrading EPEL repository:

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

Cleaning full temporary files kept on the repository

dnf clean all

removing kernels

rpm -e `rpm -q kernel`

Removing conflicting

rpm -e --nodeps sysvinit-tools

Now we launch the upgrade

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

Processing new configuration:

rpmconf -a

Confirm that new kernel-core is properly installed:

rpm -e kernel-core
dnf -y install kernel-core

Confirm that grub is updated and in the right place

ROOTDEV=`ls /dev/*da|head -1`;
echo "Detected root as $ROOTDEV..."
grub2-install $ROOTDEV

Install Minimal package:

dnf -y groupupdate "Core" "Minimal Install"

Check Centos version:

cat /etc/centos-release

CentOS Upgraded successfully

CentOS Boot screen

Brought to you by Web Designer
Kuala Lumpur

Leave a Reply

Your email address will not be published. Required fields are marked *

*