The unsupported operating systems versions will no longer receive security updates. If keeping the outdated version, some unauthorized people may target those outdated operating systems because of their vulnerability, allowing them to breach the server and gain personal information. The best possible way to prevent them is to update your operating system to the latest version regularly.
The below steps can be followed to update the version for CentOS, Ubuntu & Debian.
Check the current CentOS version in the server using the following command.
# cat /etc/redhat-release
Once checked, then need to install EPEL Repository in the server.
# yum install epel-release -y
![Centosupgrade1](https://www.layerstack.com/img/docs/resources/centosupgrade1.png)
Install yum-utils in the server.
# yum install yum-utils
![Centosupgrade2](https://www.layerstack.com/img/docs/resources/centosupgrade2.png)
Then need to resolve RPM packages in the server.
# yum install rpmconf
AND
# rpmconf -a
![Centosupgrade3](https://www.layerstack.com/img/docs/resources/centosupgrade3.png)
![Centosupgrade10](https://www.layerstack.com/img/docs/resources/centosupgrade10.png)
Install dnf in the server, dnf is the default package manager for CentOS 8
.
# yum install dnf
![Centosupgrade4](https://www.layerstack.com/img/docs/resources/centosupgrade4.png)
Remove the yum package manager from the server.
# dnf -y remove yum yum-metadata-parser
AND
# rm -Rf /etc/yum
![Centosupgrade5](https://www.layerstack.com/img/docs/resources/centosupgrade5.png)
![Centosupgrade11](https://www.layerstack.com/img/docs/resources/centosupgrade11.png)
Upgrading CentOS 7 to CentOS 8.
# dnf upgrade
![Centosupgrade6](https://www.layerstack.com/img/docs/resources/centosupgrade6.png)
Install CentOS 8 release packages on the server.
# 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
![Centosupgrade7](https://www.layerstack.com/img/docs/resources/centosupgrade7.png)
Remove all the temporary files.
# dnf clean all
![Centosupgrade12](https://www.layerstack.com/img/docs/resources/centosupgrade12.png)
Need to remove the old kernel core of CentOS 7.
# rpm -e `rpm -q kernel`
![Centosupgrade13](https://www.layerstack.com/img/docs/resources/centosupgrade13.png)
Remove conflicting packages.
# rpm -e --nodeps sysvinit-tools
![Centosupgrade14](https://www.layerstack.com/img/docs/resources/centosupgrade14.png)
Launch the CentOS 8
system upgrade as shown.
# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
![Centosupgrade14](https://www.layerstack.com/img/docs/resources/centosupgrade15.png)
![Centosupgrade14](https://www.layerstack.com/img/docs/resources/centosupgrade16.png)
Install new Kernel Core for CentOS 8.
# dnf -y install kernel-core
![Centosupgrade8](https://www.layerstack.com/img/docs/resources/centosupgrade8.png)
Install minimal package for CentOS 8.
# dnf -y groupupdate "Core" "Minimal Install"
![Centosupgrade17](https://www.layerstack.com/img/docs/resources/centosupgrade17.png)
All the steps done. Now you can check the CentOS version in the server.
# cat /etc/redhat-release
![Centosupgrade9](https://www.layerstack.com/img/docs/resources/centosupgrade9.png)