DEV Community

Cover image for Centos 7 to 8 Upgrade

Centos 7 to 8 Upgrade

tomahawkpilot profile image syamkumar ・2 min read

Alt Text

Red Hat Enterprise Linux 8 was released on 2019-05-07, and everyone is waiting to find out when the CentOS rebuild will occur. This document is meant to cover general questions and a timeline for what is happening.

A CentOS major release takes a lot of planning and changes in tooling as it is based on a much newer version of Fedora than previous versions. This means that everything from the installer, packages, packaging, and build systems need major overhauls to work with the newer OS. This means that there is always a ramp-up period depending on the changes needed to make a rebuild work. The differences between EL-8 and EL-7 are no exception as the kernel has changed drastically, the repository format has added 'modules' and RPMS has grown many features that EL7 and before do not have. About the only item which has not drastically changed between EL7 and EL8 is the init system which is still system.

To upgrade centos 7 to centos 8

Login as sudo sudo --login

Steps :

  • Install Epel release package
yum install epel-release -y
  • Install yum utils
yum install yum-utils -y
  • Resolve RPM packages by executing the command.
yum install rpmconf -y
rpmconf -a
  • Perform a clean-up of all the packages you don’t require.
 package-cleanup --leaves
 package-cleanup --orphans
  • Install DNF package manager since Centos 8 uses DNF instead of yum
yum install dnf -y 
  • Remove yum package manager which was part of centos 7
dnf -y remove yum yum-metadata-parser 
rm -Rf /etc/yum
  • Run dnf upgrade -y

  • install CentOS 8 release package

dnf install
  • upgrade the EPEL repository.
dnf -y upgrade
  • remove all the temporary files.
dnf clean all 
  • Remove the old kernel core for CentOS 7.
 rpm -e `rpm -q kernel` 
  • to remove conflicting packages.
rpm -e --nodeps sysvinit-tools 
  • launch the CentOS 8 system upgrade
 dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync 

Troubleshooting for common errors during this step.

  • Python 3 dependency error. fix by

dnf remove python3

  • Segmentation fault
rm -rf /var/lib/rpm/__db.*
rpm --rebuilddb
dnf clean all
dnf makecache
  • install a new kernel for CentOS 8
dnf -y install kernel-core
  • install CentOS 8 minimal package
dnf -y groupupdate "Core" "Minimal Install"
  • check the version of CentOS installed by running.
cat /etc/redhat-release

You have complete Centos Upgrade

Discussion (0)

Forem Open with the Forem app