Cyberithub

Upgrade to CentOS 8 from CentOS 7 Using 20 Easy Steps

Advertisements

In this article, I will take you through the Upgrade to CentOS 8 from CentOS 7 using 20 Easy Steps. CentOS 8 was officially released on September 24th, 2019. As you might already know that CentOS is community based operating system in line with Red Hat Based Projects. Since the release of CentOS 8 many Organizations are planning to use the latest OS.

In continuation to that it is very important for you to update yourself with the clear steps to upgrade CentOS 7 Systems to latest CentOS 8 version.

Upgrade to CentOS 8 from CentOS 7 Using 20 Easy Steps 1

Upgrade CentOS 7 to CentOS 8

Also Read: 14 Useful APT CACHE Examples on Ubuntu 18.04

Step 1: Check OS Version

First check the current OS version from /etc/redhat-release file. As you can see current OS version is 7.7.1908.

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)

You can also use uname -r command to check the Kernel version.

[root@localhost ~]# uname -r
3.10.0-1062.9.1.el7.x86_64

Step 2: Install EPEL Package

Now you are going to need few packages from EPEL yum Repository so you need to install EPEL(Extra Package for Enterprise Linux) package for that and enable it using yum -y install epel-release command as shown below.

[root@localhost ~]# yum -y install epel-release
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
epel-release noarch 7-11 extras 15 k

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 15 k
Installed size: 24 k
Downloading packages:

Step 3: Install rpmconf and yum-utils Packages

After installing EPEL package, it is now time to install few other packages like rpmconf and yum-utils  which is required for the upgradation using yum -y install rpmconf yum-utils command as shown below.

[root@localhost ~]# yum -y install rpmconf yum-utils
epel | 5.3 kB 00:00:00
(1/3): epel/x86_64/group_gz | 95 kB 00:00:00
(2/3): epel/x86_64/primary_db | 6.7 MB 00:00:03
(3/3): epel/x86_64/updateinfo | 1.0 MB 00:00:57
Resolving Dependencies
--> Running transaction check
---> Package rpmconf.noarch 0:0.3.4-1.el7 will be installed
---> Package yum-utils.noarch 0:1.1.31-52.el7 will be installed
--> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-52.el7.noarch
--> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-52.el7.noarch
--> Running transaction check
---> Package libxml2-python.x86_64 0:2.9.1-6.el7_2.3 will be installed
---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed
--> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch
--> Running transaction check
---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
rpmconf noarch 0.3.4-1.el7 epel 21 k
yum-utils noarch 1.1.31-52.el7 base 121 k
Installing for dependencies:
libxml2-python x86_64 2.9.1-6.el7_2.3 base 247 k
python-chardet noarch 2.2.1-3.el7 base 227 k
python-kitchen noarch 1.1.1-5.el7 base 267 k

Transaction Summary
========================================================================================================================================================================
Install 2 Packages (+3 Dependent packages)

Total download size: 883 k
Installed size: 4.3 M
Downloading packages:
(1/5): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00
(2/5): libxml2-python-2.9.1-6.el7_2.3.x86_64.rpm | 247 kB 00:00:00
(3/5): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00
(4/5): yum-utils-1.1.31-52.el7.noarch.rpm | 121 kB 00:00:00
warning: /var/cache/yum/x86_64/7/epel/packages/rpmconf-0.3.4-1.el7.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Public key for rpmconf-0.3.4-1.el7.noarch.rpm is not installed
(5/5): rpmconf-0.3.4-1.el7.noarch.rpm | 21 kB 00:00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.1 MB/s | 883 kB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : "Fedora EPEL (7) <epel@fedoraproject.org>"
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
Package : epel-release-7-11.noarch (@extras)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : python-chardet-2.2.1-3.el7.noarch 1/5
Installing : python-kitchen-1.1.1-5.el7.noarch 2/5
Installing : libxml2-python-2.9.1-6.el7_2.3.x86_64 3/5
Installing : yum-utils-1.1.31-52.el7.noarch 4/5
Installing : rpmconf-0.3.4-1.el7.noarch 5/5
Verifying : python-kitchen-1.1.1-5.el7.noarch 1/5
Verifying : rpmconf-0.3.4-1.el7.noarch 2/5
Verifying : yum-utils-1.1.31-52.el7.noarch 3/5
Verifying : libxml2-python-2.9.1-6.el7_2.3.x86_64 4/5
Verifying : python-chardet-2.2.1-3.el7.noarch 5/5

Installed:
rpmconf.noarch 0:0.3.4-1.el7 yum-utils.noarch 0:1.1.31-52.el7

Dependency Installed:
libxml2-python.x86_64 0:2.9.1-6.el7_2.3 python-chardet.noarch 0:2.2.1-3.el7 python-kitchen.noarch 0:1.1.1-5.el7

Complete!

Step 4: Remove Conflicting Configuration

After successful installation of all the required packages, you can find and remove all the conflicting configuration files by using rpmconf -a command as shown below.

[root@localhost ~]# rpmconf -a

Step 5: Cleanup Packages

Now you can find out all the rpm packages that are not relied upon by any other rpm packages in the system using package-cleanup --leaves command.

[root@localhost ~]# package-cleanup --leaves
Loaded plugins: fastestmirror
libsysfs-2.1.0-16.el7.x86_64

Now you can list out all installed rpm packages which are not available from currently configured repositories using package-cleanup --orphans command. You can check more options of package-cleanup command from Package-Cleanup Man Page.

[root@localhost ~]# package-cleanup --orphans
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* epel: mirrors.piconets.webwerks.in
* extras: mirrors.piconets.webwerks.in
* updates: mirrors.piconets.webwerks.in
chefdk-4.6.35-1.el7.x86_64

Step 6: Manually remove all unnecessary packages

You can remove all the unnecessary packages which are now not required using below yum command.

[root@localhost ~]# yum remove -y libsysfs-2.1.0-16.el7.x86_64 chefdk-4.6.35-1.el7.x86_64

Step 7: Install dnf 

It is now time to install dnf tool using yum -y install dnf command using which we will upgrade the current CentOS version to CentOS 8. We do not need yum command now for the upgradation.

[root@localhost ~]# yum -y install dnf
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.piconets.webwerks.in
* epel: mirrors.piconets.webwerks.in
* extras: mirrors.piconets.webwerks.in
* updates: mirrors.piconets.webwerks.in
Resolving Dependencies
--> Running transaction check
---> Package dnf.noarch 0:4.0.9.2-1.el7_6 will be installed
--> Processing Dependency: python2-dnf = 4.0.9.2-1.el7_6 for package: dnf-4.0.9.2-1.el7_6.noarch
--> Running transaction check
---> Package python2-dnf.noarch 0:4.0.9.2-1.el7_6 will be installed
--> Processing Dependency: dnf-data = 4.0.9.2-1.el7_6 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: python2-libdnf >= 0.22.5 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: python2-libcomps >= 0.1.8 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: python2-hawkey >= 0.22.5 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: libmodulemd >= 1.4.0 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: python2-libdnf for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: python-enum34 for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Processing Dependency: deltarpm for package: python2-dnf-4.0.9.2-1.el7_6.noarch
--> Running transaction check
---> Package deltarpm.x86_64 0:3.6-3.el7 will be installed
---> Package dnf-data.noarch 0:4.0.9.2-1.el7_6 will be installed
--> Processing Dependency: libreport-filesystem for package: dnf-data-4.0.9.2-1.el7_6.noarch
---> Package libmodulemd.x86_64 0:1.6.3-1.el7 will be installed
---> Package python-enum34.noarch 0:1.0.4-1.el7 will be installed
---> Package python2-hawkey.x86_64 0:0.22.5-1.el7_6 will be installed
--> Processing Dependency: libdnf(x86-64) = 0.22.5-1.el7_6 for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: libsolvext.so.0(SOLV_1.0)(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: libsolv.so.0(SOLV_1.0)(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: libsolvext.so.0()(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: libsolv.so.0()(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: librepo.so.0()(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
--> Processing Dependency: libdnf.so.2()(64bit) for package: python2-hawkey-0.22.5-1.el7_6.x86_64
---> Package python2-libcomps.x86_64 0:0.1.8-13.el7 will be installed
--> Processing Dependency: libcomps(x86-64) = 0.1.8-13.el7 for package: python2-libcomps-0.1.8-13.el7.x86_64
--> Processing Dependency: libcomps.so.0.1.6()(64bit) for package: python2-libcomps-0.1.8-13.el7.x86_64
---> Package python2-libdnf.x86_64 0:0.22.5-1.el7_6 will be installed
--> Running transaction check
---> Package libcomps.x86_64 0:0.1.8-13.el7 will be installed
---> Package libdnf.x86_64 0:0.22.5-1.el7_6 will be installed
---> Package librepo.x86_64 0:1.8.1-7.el7 will be installed
---> Package libreport-filesystem.x86_64 0:2.1.11-43.el7.centos will be installed
---> Package libsolv.x86_64 0:0.6.34-4.el7 will be installed

Step 8: Build DNF Cache

You can build cache for yum repository using dnf makecache command as shown below.

[root@localhost ~]# dnf makecache
CentOS-7 - AppStream 4.6 kB/s | 4.3 kB 00:00
CentOS-7 - Base 5.1 kB/s | 3.8 kB 00:00
CentOS-7 - Extras 3.6 kB/s | 1.5 kB 00:00
Extra Packages for Enterprise Linux Modular 7 - x86_64 7.4 kB/s | 9.6 kB 00:01
Extra Packages for Enterprise Linux 7 - x86_64 8.9 kB/s | 8.2 kB 00:00
Google Cloud SDK 198 B/s | 454 B 00:02
Metadata cache created.

Step 9: Remove metadata-parser package

Once dnf package Manager is installed, we can use it remove yum and yum-metadata-parser package which are now not required in the System using dnf -y remove yum yum-metadata-parser command as shown below.

[root@localhost ~]# dnf -y remove yum yum-metadata-parser
Dependencies resolved.
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Removing:
yum noarch 3.4.3-163.el7.centos @System 5.6 M
yum-metadata-parser x86_64 1.1.4-10.el7 @System 57 k
Removing dependent packages:
yum-plugin-fastestmirror noarch 1.1.31-52.el7 @System 53 k
yum-utils noarch 1.1.31-52.el7 @System 337 k

Transaction Summary
========================================================================================================================================================================
Remove 4 Packages

Freed space: 6.0 M
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Erasing : yum-utils-1.1.31-52.el7.noarch 1/4
Erasing : yum-plugin-fastestmirror-1.1.31-52.el7.noarch 2/4
Erasing : yum-3.4.3-163.el7.centos.noarch 3/4
Erasing : yum-metadata-parser-1.1.4-10.el7.x86_64 4/4
Verifying : yum-3.4.3-163.el7.centos.noarch 1/4
Verifying : yum-metadata-parser-1.1.4-10.el7.x86_64 2/4
Verifying : yum-plugin-fastestmirror-1.1.31-52.el7.noarch 3/4
Verifying : yum-utils-1.1.31-52.el7.noarch 4/4

Removed:
yum-3.4.3-163.el7.centos.noarch yum-metadata-parser-1.1.4-10.el7.x86_64 yum-plugin-fastestmirror-1.1.31-52.el7.noarch yum-utils-1.1.31-52.el7.noarch

Complete!

Remove left over yum files using rm -Rf /etc/yum command.

[root@localhost ~]# rm -Rf /etc/yum

Step 10: Upgrade using dnf

Once all the cleanup is done, it is now time to upgrade all CentOS 7 packages using dnf -y upgrade command as shown below.

[root@localhost ~]# dnf -y upgrade
Extra Packages for Enterprise Linux 7 - x86_64 4.1 MB/s | 16 MB 00:03
CentOS-7 - Base 3.6 MB/s | 10 MB 00:02
CentOS-7 - Updates 4.6 MB/s | 9.4 MB 00:02
Google Cloud SDK 0.0 B/s | 0 B 00:00
Google Cloud SDK 0.0 B/s | 0 B 00:00
Importing GPG key 0xA7317B0F:
Userid : "Google Cloud Packages Automatic Signing Key <gc-team@google.com>"
Fingerprint: D0BC 747F D8CA F711 7500 D6FA 3746 C208 A731 7B0F
From : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Importing GPG key 0xBA07F4FB:
Userid : "Google Cloud Packages Automatic Signing Key <gc-team@google.com>"
Fingerprint: 54A6 47F9 048D 5688 D7DA 2ABE 6A03 0B21 BA07 F4FB
From : https://packages.cloud.google.com/yum/doc/yum-key.gpg
Google Cloud SDK 0.0 B/s | 0 B 00:00
Importing GPG key 0x3E1BA8D5:
Userid : "Google Cloud Packages RPM Signing Key <gc-team@google.com>"
Fingerprint: 3749 E1BA 95A8 6CE0 5454 6ED2 F09C 394C 3E1B A8D5
From : https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Google Cloud SDK 4.5 MB/s | 33 MB 00:07
CentOS-7 - Extras 903 kB/s | 258 kB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 23 Mar 2020 06:29:36 AM EDT.
Dependencies resolved.
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
kernel x86_64 3.10.0-1062.18.1.el7 updates 50 M
Upgrading:
epel-release noarch 7-12 epel 15 k
NetworkManager x86_64 1:1.18.0-5.el7_7.2 updates 1.9 M
NetworkManager-libnm x86_64 1:1.18.0-5.el7_7.2 updates 1.7 M
NetworkManager-team x86_64 1:1.18.0-5.el7_7.2 updates 163 k
NetworkManager-tui x86_64 1:1.18.0-5.el7_7.2 updates 327 k
binutils x86_64 2.27-41.base.el7_7.3 updates 5.9 M
ca-certificates noarch 2019.2.32-76.el7_7 updates 399 k
curl x86_64 7.29.0-54.el7_7.2 updates 270 k
firewalld noarch 0.6.3-2.el7_7.4 updates 441 k
firewalld-filesystem noarch 0.6.3-2.el7_7.4 updates 50 k
git x86_64 1.8.3.1-21.el7_7 updates 4.4 M
iproute x86_64 4.11.0-25.el7_7.2 updates 803 k
iprutils x86_64 2.4.17.1-3.el7_7 updates 243 k
java-11-openjdk x86_64 1:11.0.6.10-1.el7_7 updates 213 k
java-11-openjdk-devel x86_64 1:11.0.6.10-1.el7_7 updates 3.3 M
java-11-openjdk-headless x86_64 1:11.0.6.10-1.el7_7 updates 39 M
kernel-tools x86_64 3.10.0-1062.18.1.el7 updates 7.9 M
kernel-tools-libs x86_64 3.10.0-1062.18.1.el7 updates 7.8 M
kmod x86_64 20-25.el7_7.1 updates 122 k
kmod-libs x86_64 20-25.el7_7.1 updates 51 k
libblkid x86_64 2.23.2-61.el7_7.1 updates 181 k
libcurl x86_64 7.29.0-54.el7_7.2 updates 223 k
libmount x86_64 2.23.2-61.el7_7.1 updates 183 k
libsmartcols x86_64 2.23.2-61.el7_7.1 updates 141 k
libuuid x86_64 2.23.2-61.el7_7.1 updates 83 k
microcode_ctl x86_64 2:2.1-53.7.el7_7 updates 2.5 M
nss x86_64 3.44.0-7.el7_7 updates 854 k
nss-softokn x86_64 3.44.0-8.el7_7 updates 330 k
nss-softokn-freebl x86_64 3.44.0-8.el7_7 updates 224 k
nss-sysinit x86_64 3.44.0-7.el7_7 updates 65 k
nss-tools x86_64 3.44.0-7.el7_7 updates 528 k

Removing:
kernel x86_64 3.10.0-1062.el7 @System 64 M
kernel x86_64 3.10.0-1062.1.1.el7 @System 64 M

Transaction Summary
========================================================================================================================================================================
Install 1 Package
Upgrade 52 Packages
Remove 2 Packages

Total download size: 230 M
Downloading Packages:
(1/53): epel-release-7-12.noarch.rpm 157 kB/s | 15 kB 00:00
(2/53): NetworkManager-libnm-1.18.0-5.el7_7.2.x86_64.rpm 1.9 MB/s | 1.7 MB 00:00
(3/53): NetworkManager-team-1.18.0-5.el7_7.2.x86_64.rpm 1.3 MB/s | 163 kB 00:00
(4/53): NetworkManager-tui-1.18.0-5.el7_7.2.x86_64.rpm 1.5 MB/s | 327 kB 00:00
(5/53): NetworkManager-1.18.0-5.el7_7.2.x86_64.rpm 1.3 MB/s | 1.9 MB 00:01
(6/53): ca-certificates-2019.2.32-76.el7_7.noarch.rpm 955 kB/s | 399 kB 00:00
(7/53): curl-7.29.0-54.el7_7.2.x86_64.rpm 980 kB/s | 270 kB 00:00
(8/53): firewalld-0.6.3-2.el7_7.4.noarch.rpm 1.1 MB/s | 441 kB 00:00
(9/53): firewalld-filesystem-0.6.3-2.el7_7.4.noarch.rpm 644 kB/s | 50 kB 00:00
(10/53): binutils-2.27-41.base.el7_7.3.x86_64.rpm 2.2 MB/s | 5.9 MB 00:02
(11/53): iproute-4.11.0-25.el7_7.2.x86_64.rpm 2.0 MB/s | 803 kB 00:00
(12/53): iprutils-2.4.17.1-3.el7_7.x86_64.rpm 1.5 MB/s | 243 kB 00:00
(13/53): java-11-openjdk-11.0.6.10-1.el7_7.x86_64.rpm 1.2 MB/s | 213 kB 00:00
(14/53): git-1.8.3.1-21.el7_7.x86_64.rpm 1.3 MB/s | 4.4 MB 00:03
(15/53): java-11-openjdk-devel-11.0.6.10-1.el7_7.x86_64.rpm 2.2 MB/s | 3.3 MB 00:01
(16/53): kernel-tools-3.10.0-1062.18.1.el7.x86_64.rpm 2.1 MB/s | 7.9 MB 00:03
(17/53): kernel-tools-libs-3.10.0-1062.18.1.el7.x86_64.rpm 2.1 MB/s | 7.8 MB 00:03
(18/53): kmod-20-25.el7_7.1.x86_64.rpm 1.7 MB/s | 122 kB 00:00
(19/53): kmod-libs-20-25.el7_7.1.x86_64.rpm 812 kB/s | 51 kB 00:00
(20/53): libblkid-2.23.2-61.el7_7.1.x86_64.rpm 1.6 MB/s | 181 kB 00:00
(21/53): libcurl-7.29.0-54.el7_7.2.x86_64.rpm 2.0 MB/s | 223 kB 00:00
(22/53): libmount-2.23.2-61.el7_7.1.x86_64.rpm 1.3 MB/s | 183 kB 00:00
(23/53): libsmartcols-2.23.2-61.el7_7.1.x86_64.rpm 1.4 MB/s | 141 kB 00:00
(24/53): libuuid-2.23.2-61.el7_7.1.x86_64.rpm 1.0 MB/s | 83 kB 00:00
(25/53): microcode_ctl-2.1-53.7.el7_7.x86_64.rpm 2.7 MB/s | 2.5 MB 00:00
(26/53): nss-3.44.0-7.el7_7.x86_64.rpm 3.0 MB/s | 854 kB 00:00
(27/53): nss-softokn-3.44.0-8.el7_7.x86_64.rpm 1.9 MB/s | 330 kB 00:00
(28/53): nss-softokn-freebl-3.44.0-8.el7_7.x86_64.rpm 2.1 MB/s | 224 kB 00:00
(29/53): nss-sysinit-3.44.0-7.el7_7.x86_64.rpm 1.2 MB/s | 65 kB 00:00
(30/53): nss-tools-3.44.0-7.el7_7.x86_64.rpm 2.4 MB/s | 528 kB 00:00
(31/53): nss-util-3.44.0-4.el7_7.x86_64.rpm 1.3 MB/s | 79 kB 00:00
(32/53): numactl-libs-2.0.12-3.el7_7.1.x86_64.rpm 387 kB/s | 30 kB 00:00
(33/53): perl-Git-1.8.3.1-21.el7_7.noarch.rpm 773 kB/s | 55 kB 00:00
(34/53): python-firewall-0.6.3-2.el7_7.4.noarch.rpm 1.8 MB/s | 353 kB 00:00
(35/53): python-perf-3.10.0-1062.18.1.el7.x86_64.rpm 3.0 MB/s | 7.9 MB 00:02
(36/53): rsyslog-8.24.0-41.el7_7.4.x86_64.rpm 2.4 MB/s | 618 kB 00:00
(37/53): selinux-policy-3.13.1-252.el7_7.6.noarch.rpm 2.0 MB/s | 492 kB 00:00
(38/53): selinux-policy-targeted-3.13.1-252.el7_7.6.noarch.rpm 2.5 MB/s | 7.0 MB 00:02
(39/53): sg3_utils-1.37-18.el7_7.2.x86_64.rpm 2.3 MB/s | 646 kB 00:00
(40/53): sg3_utils-libs-1.37-18.el7_7.2.x86_64.rpm 972 kB/s | 65 kB 00:00
(41/53): sqlite-3.7.17-8.el7_7.1.x86_64.rpm 1.8 MB/s | 394 kB 00:00
(42/53): subscription-manager-rhsm-certificates-1.24.13-4.el7.centos.x86_64.rpm 1.3 MB/s | 228 kB 00:00
(43/53): sudo-1.8.23-4.el7_7.2.x86_64.rpm 1.5 MB/s | 842 kB 00:00
(44/53): systemd-219-67.el7_7.4.x86_64.rpm 1.7 MB/s | 5.1 MB 00:03
(45/53): systemd-libs-219-67.el7_7.4.x86_64.rpm 1.5 MB/s | 411 kB 00:00
(46/53): systemd-sysv-219-67.el7_7.4.x86_64.rpm 1.3 MB/s | 89 kB 00:00
(47/53): util-linux-2.23.2-61.el7_7.1.x86_64.rpm 2.0 MB/s | 2.0 MB 00:00
(48/53): kernel-3.10.0-1062.18.1.el7.x86_64.rpm 1.2 MB/s | 50 MB 00:39
(49/53): java-11-openjdk-headless-11.0.6.10-1.el7_7.x86_64.rpm 1.1 MB/s | 39 MB 00:35
(50/53): docker-client-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm 1.5 MB/s | 3.9 MB 00:02
(51/53): docker-common-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm 844 kB/s | 98 kB 00:00
(52/53): 542e19271992454de06b221528922a2e49e7165678a3e02af62e24cac1ce513d-google-cloud-sdk-285.0.1-1.noarch.rpm 3.0 MB/s | 53 MB 00:17
(53/53): docker-1.13.1-109.gitcccb291.el7.centos.x86_64.rpm 2.0 MB/s | 18 MB 00:08
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 4.5 MB/s | 230 MB 00:51
Running transaction check
Transaction check succeeded.

Step 11: Upgrade CentOS 7 Release Packages

Now it is time to upgrade CentOS 7 release-package to CentOS 8 release-package to upgrade YUM Repository using below dnf upgrade command.

[root@localhost ~]# dnf upgrade -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{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}
Last metadata expiration check: 0:01:45 ago on Mon 23 Mar 2020 06:46:01 AM EDT.
centos-release-8.1-1.1911.0.8.el8.x86_64.rpm 153 kB/s | 21 kB 00:00
centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm 122 kB/s | 11 kB 00:00
centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm 110 kB/s | 12 kB 00:00
Package centos-gpg-keys not installed, cannot update it.
No match for argument: /var/cache/dnf/commandline-5fda33494c9fb882/packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
Package centos-repos not installed, cannot update it.
No match for argument: /var/cache/dnf/commandline-5fda33494c9fb882/packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm
Dependencies resolved.
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Upgrading:
centos-release x86_64 8.1-1.1911.0.8.el8 @commandline 21 k
Installing dependencies:
centos-gpg-keys noarch 8.1-1.1911.0.8.el8 @commandline 11 k
centos-repos x86_64 8.1-1.1911.0.8.el8 @commandline 12 k

Transaction Summary
========================================================================================================================================================================
Install 2 Packages
Upgrade 1 Package

Total size: 44 k
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch 1/4
Installing : centos-repos-8.1-1.1911.0.8.el8.x86_64 2/4
Upgrading : centos-release-8.1-1.1911.0.8.el8.x86_64 3/4
Cleanup : centos-release-7-7.1908.0.el7.centos.x86_64 4/4
warning: file /etc/yum/vars/infra: remove failed: No such file or directory
warning: file /etc/yum/vars/contentdir: remove failed: No such file or directory

Verifying : centos-gpg-keys-8.1-1.1911.0.8.el8.noarch 1/4
Verifying : centos-repos-8.1-1.1911.0.8.el8.x86_64 2/4
Verifying : centos-release-8.1-1.1911.0.8.el8.x86_64 3/4
Verifying : centos-release-7-7.1908.0.el7.centos.x86_64 4/4

Upgraded:
centos-release-8.1-1.1911.0.8.el8.x86_64

Installed:
centos-gpg-keys-8.1-1.1911.0.8.el8.noarch centos-repos-8.1-1.1911.0.8.el8.x86_64

Complete!

Step 12: Upgrade EPEL Package

Once CentOS 8 Release Packages are upgraded, we now need to upgrade EPEL package using dnf upgrade -y epel-release command as shown below.

[root@localhost ~]# dnf upgrade -y epel-release
Extra Packages for Enterprise Linux 7 - x86_64 2.8 MB/s | 16 MB 00:05
CentOS-8 - Base 5.5 MB/s | 5.0 MB 00:00
CentOS-8 - AppStream 221 kB/s | 6.5 MB 00:30
CentOS-8 - Extras 39 kB/s | 4.2 kB 00:00
Last metadata expiration check: 0:00:01 ago on Mon 23 Mar 2020 06:49:46 AM EDT.
Dependencies resolved.
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Upgrading:
epel-release noarch 8-8.el8 extras 23 k

Transaction Summary
========================================================================================================================================================================
Upgrade 1 Package

Total download size: 23 k
Downloading Packages:
epel-release-8-8.el8.noarch.rpm 138 kB/s | 23 kB 00:00
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 32 kB/s | 23 kB 00:00
warning: /var/cache/dnf/extras-2770d521ba03e231/packages/epel-release-8-8.el8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
CentOS-8 - Extras 0.0 B/s | 0 B 00:00
Importing GPG key 0x8483C65D:
Userid : "CentOS (CentOS Official Signing Key) <security@centos.org>"
Fingerprint: 99DB 70FA E1D7 CE22 7FB6 4882 05B5 55B3 8483 C65D
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Key imported successfully
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Upgrading : epel-release-8-8.el8.noarch 1/2
Cleanup : epel-release-7-12.noarch 2/2
Verifying : epel-release-8-8.el8.noarch 1/2
Verifying : epel-release-7-12.noarch 2/2

Upgraded:
epel-release-8-8.el8.noarch

Complete!

Step 13: Cleanup all

You can clean up all the files which is not required using dnf clean all command as shown below.

[root@localhost ~]# dnf clean all
68 files removed

Step 14: Remove older Kernel

You can either keep the older kernels or remove it all as older kernels are now not required for CentOS 8.

[root@localhost ~]# rpm -e `rpm -q kernel`

Step 15: Remove Conflicting Packages

You can remove all the System conflicting packages using below command as it is not required in CentOS 8.

[root@localhost ~]# rpm -e --nodeps sysvinit-tools

Step 16: Upgrade Your System to CentOS 8

Now we need to use dnf tool to upgrade our system to CentOS 8 release using below command.

[root@localhost ~]# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
Upgrading : wget-1.19.5-8.el8_1.1.x86_64 496/976
Running scriptlet: wget-1.19.5-8.el8_1.1.x86_64 496/976
Installing : python2-pip-9.0.3-14.module_el8.1.0+219+cf9e6ac9.noarch 497/976
Installing : python2-pyyaml-3.12-16.module_el8.1.0+219+cf9e6ac9.x86_64 498/976
Upgrading : kbd-2.0.4-8.el8.x86_64 499/976
Upgrading : libSM-1.2.3-1.el8.x86_64 500/976
Upgrading : sg3_utils-1.44-3.el8.x86_64 501/976
Downgrading : irqbalance-2:1.4.0-4.el8.x86_64 502/976
Running scriptlet: irqbalance-2:1.4.0-4.el8.x86_64 502/976
Installing : python3-dmidecode-3.12.2-15.el8.x86_64 503/976
Upgrading : javapackages-tools-5.3.0-1.module_el8.0.0+11+5b8c10bd.noarch 504/976
Upgrading : passwd-0.80-2.el8.x86_64 505/976
Installing : gnupg2-smime-2.2.9-1.el8.x86_64 506/976
Upgrading : sudo-1.8.25p1-8.el8_1.x86_64 507/976
Running scriptlet: sudo-1.8.25p1-8.el8_1.x86_64 507/976
Installing : python3-pytoml-0.1.14-5.git7dea353.el8.noarch 508/976
Upgrading : kernel-tools-4.18.0-147.5.1.el8_1.x86_64 509/976
Running scriptlet: man-db-2.7.6.1-17.el8.x86_64 510/976
Upgrading : man-db-2.7.6.1-17.el8.x86_64 510/976
Running scriptlet: man-db-2.7.6.1-17.el8.x86_64 510/976
Upgrading : libdrm-2.4.98-2.el8.x86_64 511/976
Installing : fuse-overlayfs-0.7.2-1.module_el8.1.0+272+3e64ee36.x86_64 512/976
Upgrading : e2fsprogs-1.44.6-3.el8.x86_64 513/976
Upgrading : perl-IO-Compress-2.081-1.el8.noarch 514/976

Step 17: Install Kernel Package

Next step is to install Kernel core package using dnf install -y kernel-core command as shown below. This kernel core package is required for CentOS 8.

[root@localhost ~]# dnf install -y kernel-core
Last metadata expiration check: 0:23:51 ago on Mon 23 Mar 2020 06:53:40 AM EDT.
Dependencies resolved.
========================================================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================================================
Installing:
kernel-core x86_64 4.18.0-147.5.1.el8_1 BaseOS 25 M

Transaction Summary
========================================================================================================================================================================
Install 1 Package

Total download size: 25 M
Installed size: 58 M
Downloading Packages:
kernel-core-4.18.0-147.5.1.el8_1.x86_64.rpm 3.4 MB/s | 25 MB 00:07
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 3.0 MB/s | 25 MB 00:08
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.

Step 18: Minimal Installation

You can use minimal installation by running dnf -y groupupdate "Core" "Minimum Install" command as shown below.

[root@localhost ~]# dnf -y groupupdate "Core" "Minimal Install"
Last metadata expiration check: 0:25:07 ago on Mon 23 Mar 2020 06:53:40 AM EDT.
Dependencies resolved.
========================================================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================================================
Installing group/module packages:
dnf-plugin-spacewalk noarch 2.8.5-11.module_el8.1.0+211+ad6c0bc7 AppStream 24 k
dnf-plugins-core noarch 4.0.8-3.el8 BaseOS 62 k
prefixdevname x86_64 0.1.0-6.el8 BaseOS 466 k
rng-tools x86_64 6.6-2.el8 BaseOS 57 k
sssd-common x86_64 2.2.0-19.el8 BaseOS 1.5 M
sssd-kcm x86_64 2.2.0-19.el8 BaseOS 213 k
yum noarch 4.2.7-7.el8_1 BaseOS 181 k
Installing dependencies:
python3-dnf-plugin-spacewalk noarch 2.8.5-11.module_el8.1.0+211+ad6c0bc7 AppStream 30 k
python3-hwdata noarch 2.3.6-3.el8 AppStream 39 k
python3-netifaces x86_64 0.10.6-4.el8 AppStream 25 k
python3-newt x86_64 0.52.20-9.el8 AppStream 63 k
python3-pyOpenSSL noarch 18.0.0-1.el8 AppStream 103 k
python3-rhn-client-tools x86_64 2.8.16-13.module_el8.1.0+211+ad6c0bc7 AppStream 108 k
python3-rhnlib noarch 2.8.6-8.module_el8.1.0+211+ad6c0bc7 AppStream 77 k
rhn-client-tools x86_64 2.8.16-13.module_el8.1.0+211+ad6c0bc7 AppStream 385 k
c-ares x86_64 1.13.0-5.el8 BaseOS 93 k
libbasicobjects x86_64 0.1.1-39.el8 BaseOS 31 k
libcollection x86_64 0.7.0-39.el8 BaseOS 48 k
libdhash x86_64 0.5.0-39.el8 BaseOS 34 k
libgudev x86_64 232-4.el8 BaseOS 33 k
libini_config x86_64 1.3.1-39.el8 BaseOS 70 k
libldb x86_64 1.5.4-2.el8 BaseOS 173 k
libnfsidmap x86_64 1:2.3.3-26.el8 BaseOS 118 k
libpath_utils x86_64 0.2.1-39.el8 BaseOS 34 k
libref_array x86_64 0.1.5-39.el8 BaseOS 33 k
libsss_certmap x86_64 2.2.0-19.el8 BaseOS 128 k
libsss_idmap x86_64 2.2.0-19.el8 BaseOS 104 k
libsss_nss_idmap x86_64 2.2.0-19.el8 BaseOS 111 k
libtalloc x86_64 2.1.16-3.el8 BaseOS 49 k
libtdb x86_64 1.3.18-2.el8 BaseOS 58 k
Installing weak dependencies:
libsss_autofs x86_64 2.2.0-19.el8 BaseOS 101 k
libsss_sudo x86_64 2.2.0-19.el8 BaseOS 100 k
sssd-nfs-idmap x86_64 2.2.0-19.el8 BaseOS 97 k
Enabling module streams:
satellite-5-client 1.0
Installing Environment Groups:
Minimal Install
Installing Groups:
Core

Step 19: Restart Your System

Now you can restart your system using init 6 or reboot command to start your System with the new Kernel.

[root@localhost ~]# init 6

Step 20: Check your OS version

Once restarted, now you can now check from /etc/redhat-release file if the system is upgraded to CentOS 8 or not. As you can see from below output, OS is now upgraded to CentOS 8 version 8.1.1911.

[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)

 

 

Also Read: Upgrade CentOS 7 to 8

Reference: Steps to Upgrade CentOS 7 to CentOS 8

Leave a Comment