How to upgrade Centos 7 to 8

Install Dependencies

yum install epel-release yum-utils rpmconf -y

Uninstall duplicate/Unused Packages and Configurations

# pmconf -a
# package-cleanup --leaves
# package-cleanup --orphans

Uninstall paket yang muncul dari perintah package-cleanup dengan perintah yum remove nama_paket.

mengganti package manager dari yum ke dnf

yum install dnf

lalu menghapus paket yum:

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

megupgrade paket dengan dnf

dnf upgrade

Upgrade repository dengan dnf:

dnf upgrade{centos-release-8.1-1.1911.0.8.el8.x86_64.rpm,centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm,centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm}

Upgrade EPEL yum repository from EL 7 to EL 8:

dnf upgrade -y epel-release

build cache dnf:

dnf makecache

Upgrade Centos 7 ke Centos 8

Menghapus semua kernel yg terinstall dengan perintah:

rpm -e `rpm -q kernel`

Menghapus paket yg konflik:

rpm -e --nodeps sysvinit-tools

memulai upgrade system dengan perintah:

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

Install kernel core baru Centos 8:

dnf install -y kernel-core

Install Minimal dan Core group paket di server.

dnf -y groupupdate "Core" "Minimal Install"

Reboot lalu cek versi:

systemctl reboot