Upgrading a system is essential to staying updated in modern technologies to use new features. On 24 September 2019, CentOS officially released CentOS version 8.0, and everyone started looking to upgrade their system from CentOS 7 to 8. CentOS offers multiple features and newly developed software support, so it is good to go for the CentOS 8 instead of CentOS 7. If you are also looking to get the upgrade done in the smoothest way possible, you're in the right place. Read the complete article and get acquainted with the step-by-step approach.
For a better understanding of CentOS and its significance in the world of operating systems, check out our article on What is CentOS.
System Requirements and Features of CentOS 8
CentOS 8 build release is available for:
- ppc64le (Little Endian)
- x86_64
- aarch64 (ARM 64, ARMv8)
CentOS 8 offers multiple features that create a significant difference between CentOS 7 and CentOS 8. So these features are:
- There is a default cockpit available now.
- CentOS 8 offers the latest version of YUM, and it is based on the DNF.
- CentOS 8 supports 4PB physical memory.
- It has Python 3.6 as a default version of python.
- CentOS 8 consists of PHP 7.2 and Nginx 1.14
- In CentOS, iptables are replaced by nftables as a default framework for network filtering.
- Contents of CentOS 8 are available by two different repositories, Application Stream and BaseOS.
- In CentOS, Wayland is a default display server that replaces the Xorg server.
How to Upgrade Centos 7 to 8?
This upgrade procedure requires the installation of the EPEL Repository, so execute the below command to start the installation process:
# yum install epel-release -y
You will get a result as shown below!
[root@centos7-PCNAME:~]# yum install epel-release - y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos. mirrors. estointernet.in
* elrepo: mirror.imt-systems.com
* extras: mirrors. piconets. webwerks. in
* updates: mirrors . piconets. webwerks.in
Resolving Dependencies
--->Running transaction check
---> Package epel-release. noarch O: 7—11 will be installed
--->Finished Dependency Resolution
Dependencies Resolved
===================================================================
Package Arch version
===================================================================
Installing: noarch 7—11
epel-release
Transaction Summary
===================================================================
Install 1 Package
Total download size: 15k
Installed size: 24k
Downloading packages:
No Presto metadata available for extras
epe1-release-7-1 1 . noarch. rpm
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing: epel-release-7-1 1 . noarch
Verifying: epel-release-7-1 1 . noarch
Installed:
epel-release-7-1 1 . noarch
Complete !
[root@centos7-PCNAME:~]#
After the successful installation of EPEL, execute the below command for installing the yum utility package (this will also run the yum update to update the repository).
# yum install yum-utils
Once you install the yum-utils in the system, execute the following commands for resolving RPM packages.
# yum install rpmconf
# rpmconf -a
Now clean all of the unnecessary files from the system by executing the commands below:
# package-cleanup --leaves
# package-cleanup --orphans
After running the cleanup commands, you will get the result below!
[root@centos7-PCNAME:~]# package-cleanup --leaves
Loaded plugins: fastestmirror, langpacks
NetworkManager- libreswan-gnome-1 . 2. G-2. e17. x86-64
djvulibre-devel -3.5.25.3-14. xas_su
giflib-devel-u. 1.6-9. e17.xas_6L,
i bus-libpinyin—l . S. 91-4 .e17. x86-64
libXfont-1.5.G-1.e17. x86-64
libXt-devel-1. 1.5-3. e17. x86-64
libb10ckdev-nvdimm-2. 18-3. e17. x86-64
liberation-serif-fonts—I . 07.2- IS . e17. noarch
libproxy-mozås-O.G. 11—11.e17. x86-64
libreport-anaconda-2. 1. 1 1-42. e17. centos . x86-64
libreport-p1ugin-mai1x-2. 1. 1 1-142. e17. centos. x86-64
libreport-rhe1-anaconda-bugzilla-2. 1. 1 1-42. e17. centos. x86-64
librsvg2-devel-2. GO. 20-1 . e17. x86-64
libsane-hpaio-3. 15.9-3. e17. x86-64
3-27.
lib time zone map-O . . . e17. x86-64
1 . 2-2. e17. xas_su
Iibuser-python- 0. 60-9. e17 . x86-64
libxslt-devel-l. 1 .28-5 . e17.xas_6L,
mesa-libGLES-
python-ntp1ib-O.3.2—1 . e17 . noarch . x86-64
package-cleanup
[root@centos7-PCNAME:~]# package - cleanup -- orphans
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: centos. mirrors. estointernet.in
* elrepo: mirror.imt-systems.com
* epel: repos . del.extreme-ix.org
* extras: mirrors. piconets. webwerks.in
* updates: mirrors . piconets. webwerks.in
NetworkManager 12. o-a.e17_6. x86-64
NetworkManager -adsl-l. 12 . o-a.e17_6. x86-64
NetworkManager -bluetooth-I. 12. o-a.e17_6. x86-64
NetworkManager -glib-I. 12. o-a.e17_6. x86-64
NetworkManager -libnm-l. 12. o-a.e17_6. x86-64
NetworkManager -ppp-l. 12. o-a.e17_6. x86-64
NetworkManager -team-I. 12. o-a.e17_6. x86-64
After cleaning the system, install the DNF in CentOS 7 because DNF is CentOS 8's default package manager; execute the below command to upgrade CentOS:
# yum install dnf
Do you want to learn more about the Linux commands? Have a go through our complete guide to Linux commands.
The installation will start, and you will get a result as shown:
[root@centos7-PCNAME:~]# yum install dnf -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
base: centos.mirrors.estointernet.in
elrepo: mirror.imt-systems.com
epel: repos.del.extreme-ix.org
extras: mirrors.piconets.webwerks.in
updates: mirrors.piconets.webwerks.in
Resolving Dependencies
--> Running transaction check
---> Package dnf.noarch 0:4.0.9.2-1.e17_6 will he installed
--> Processing Dependency: python2-dnf = 4.0.9.2-1.e17_6 for package: dnf-4.0.9.2-1.e17_6.noarch
--> Running transaction check
---> Package python2-dnf.noarch 0:4.0.9.2-1.e17_6 will be installed
--> Processing Dependency: dnf-data = 4.0.9.2-1.e17_6 for package: python2-dnf-4.0.9.2-1.e17_6.noarch --> Processing Dependency: python2-lihdnf >= 0.22.5 for package: python2-dnf-4.0.9.2-1.e17_6.noarch
--> Processing Dependency: python2-libcomps >= 0.1.8 for package: python2-dnf-4.0.9.2-1.e17_6.noarch
--> Processing Dependency: python2-hawkey >= 0.22.5 for package: python2-dnf-4.0.9.2-1.e17_6.noarch --> Processing Dependency: libmodulemd >= 1.4.0 for package: python2-dnf-4.0.9.2-1.e17_6.noarch
--> Processing Dependency: python2-lihdnf for package: python2-dnf-4.0.9.2-1.e17_6.noarch
--> Running transaction check
---> Package dnf-data.noarch 0:4.0.9.2-1.e17_6 will be installed
---> Package libmodulemd.x86_64 0:1.6.3-1.e17 will be installed
--> Processing Dependency: libyam1-0.so.20(64bit) for package: libmodulemd-1.6.3-1.e17.x86_64
---> Package python2-hawkey.x86_64 0:0.22.5-1.e17_6 will be installed
Now, remove the yum package manager from the system using the following commands in the terminal:
# dnf -y remove yum yum-metadata-parser
# rm -Rf /etc/yum
Your system is now completely ready for the CentOS update. Therefore, use the DNF package manager to upgrade the system, so execute the following CentOS update command:
# dnf upgrade
After that, install the CentOS 8 package using DNF by executing the below command (this execution will take a bit of time).
# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.3-1.2011.el8.noarch.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm
Now, upgrade your EPEL repository by executing the below command in the terminal:
dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Once the EPEL repository successfully upgrades, you can remove all of the temporary files from the system.
# dnf clean all
Now, you can remove the old kernel core of CentOS 7 using this command:
# rpm -e `rpm -q kernel`
Also, use the below command for removing conflicting packages.
# rpm -e --nodeps sysvinit-tools
At last, launch the CentOS 8 using the following command:
# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
Don't forget to install a new Kernel Core for your CentOS 8 system, so run the below command for installing this Kernel:
# dnf -y install kernel-core
Now, you can install the minimal packages of CentOS by executing this command:
# dnf -y groupupdate "Core" "Minimal Install"
Finally, check the version of your CentOS by executing this command:
# cat /etc/redhat-release
If this command does not work, you can check our previous article on how to find the Linux version.
Thus, you can easily update CentOS 7 to CentOS 8 without trouble. However, completing this process by following every step carefully is essential, or you will face errors and serious software-related issues.
Before starting the upgrade, it's advisable to verify your current CentOS version to ensure compatibility and to avoid any unexpected issues during the process. For detailed instructions on checking your CentOS version, refer to our guide on how to check CentOS version.
Conclusion
In this article, we have covered the easiest and most effective procedure on how to upgrade CentOS 7 to 8. As we have mentioned previously, CentOS 8 was released and consists of multiple features and newly developed software support. If you're managing a CentOS server, these updates are essential for keeping your system secure and optimized for performance.
Hence, you can go for CentOS 8 instead of CentOS 7 to take advantage of new features, such as improved system management tools, enhanced container support, and increased compatibility with modern hardware and software. When upgrading a CentOS server, it's important to ensure that your system meets the necessary specifications for smooth operation. Make sure your hardware, available storage, and RAM meet the minimum requirements so that the upgrade process is seamless, and your CentOS server continues to perform optimally after updating your repositories.
People also read: