In this article I will explain how to upgrade 7 old CentOS version to latest version CentOS 8.
Upgrade or Update CentOS 7 to CentOS 8
Step #1 : Install EPEL Repository
# yum install epel-release -y
Step #2 : Install yum-utils Tools
# yum install yum-utils
Once above package installed now need to resolve RPM packages using below command.
# yum install rpmconf
# rpmconf -a
Let’s clean all unnecessary package which are not required.
# package-cleanup --leaves # package-cleanup --orphans
Step #3 : Install dnf package on CentOS 7
# yum install dnf
Now remove the yum package manage using below command.
# dnf -y remove yum yum-metadata-parsar # rm -Rf /etc/yum
Step #4 : Upgrade CentOS 7 to CentOS 8
All required dependencies are completed let’s upgrade CentOS 7 to CentOS 8 using dnf package manager.
# dnf upgrade
Next, Will need to install CentOS 8 release package using dnf command. Note this step will take some time.
# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-2.el8.noarch.rpm,centos-linux-release-8.4-1.2105.el8.noarch.rpm,centos-gpg-keys-8-2.el8.noarch.rpm}
Upgrade EPEL repository now.
# dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Once successfully completed above command now let’s remove the all temporary files.
# dnf clean all
Let’s remove old CentOS 7 kernel.
# rpm -e 'rpm -q kernel'
Make sure conflicted package should be removed.
# rpm -e --nodeps sysvinit-tools
Let’s start upgrading CentOS 8 like below:
# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
Step #5 : Install CentOS 8 Kernel
Run the below command to install CentOS 8 kernel as shown below:
# dnf -y install kernel-core
Now install Minimal Package for CentOS 8
# dnf -y groupupdate "Core" "Minimal Install"
Next, check the version of newly installed CentOS 8 suing below command.
# cat /etc/redhat-release
Output:
# cat /etc/redhat-release CentOS Linux release 8.0.1905 (Core)
Congratulation!! You successfully upgraded your CentOS 7 to CentOS 8.
Steps to Update or Upgrade CentOS minor Version
All CentOS 7.0, 7.1 and 7.2 users can upgrade their system to the latest version CentOS 7.3.
You can use the “update” option to upgrade all your CentOS system software to the latest version with one command.
Please take note that the use of “-y” is not recommended for yum operation. Surely you have some time to review the packages to be installed on your system by using “yum update” before allowing yum to proceed. In earlier version of CentOS, we are required to restore all programs and data but now with CentOS 7, we can upgrade directly, that being said that unexpected situation still possible, therefore, it is recommended to create a full backup of your server one time before upgrading process.
Follow the below steps to update or upgrade CentOS version.
1. First of all check the current version of your running CentOS using below command.
# cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core)
2. Take backup of important Data and directory (Example: /etc, /var, /opt). I suggest, for VMware virtual machines, take a good vmware snapshot or run a full backup of the operating systems and data. (MySQL, Apache, NGINX, DNS or etc).
3. Now upgrade with yum update command as shown below.
# yum clean all # yum update
4. After successfully upgrade reboot the system using below command.
# reboot
5. Now verify the system current running CentOS version.
# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core)
You can see above your system has been upgraded successfully.
If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.
Leave a Comment