How to Upgrade to CentOS 8

Get the latest CentOS update

CentOS is a favorite for stability and security. It’s known from providing a rock solid base for nearly any server application. The CentOS 8 release builds upon that foundation while adding a few more modern improvements to help make managing your business servers even easier.

Why You Shouldn’t Upgrade

Before you dive in, you should be aware that there is no officially supported upgrade path from the CentOS team or Red Hat. If you’re looking for the absolute most reliable way to get CentOS 8 on your servers, you should back up all of your previous data and perform a full migration to a fresh CentOS install. That said, if you want to try upgrading, it is possible. You should back up all of your data before continuing anyway to ensure that this totally unsupported upgrade method cost you anything but time, should the worst happen.

How to Upgrade From CentOS 7 to CentOS 8

Once you've decided to upgrade, here's how to do that:

  1. Back up all of your data. Seriously, do it.

    CentOS 7 Desktop
  2. Begin by installing the EPEL repository on your system, if you don’t already have it.

    CentOS 7 install EPEL
    yum -y install epel-release

  3. Now install a couple of necessary packages from the EPEL to help you reconfigure your repositories for CentOS 8.

    CentOS 7 install rpmconf
    yum -y install rpmconf yum-utils

  4. Next, you’ll need to resolve the RPM packages on the system with rpmconf. To avoid conflicts when updating, accept the default action for each configuration, when asked.

    rpmconf -a
  5. Clean up any packages that you don’t need on our system. The fewer packages you have, the less chance there is for complications.

    CentOS7 package cleanup
    package-cleanup --leaves
    package-cleanup --orphans

  6. You’re ready to start the first part of the upgrade. CentOS 8 uses the new DNF package manager. It works exactly like YUM, but it’s more efficient. It’s also the first thing you’ll need to begin the upgrade.

    CentOS 7 install DNF
    yum -y install dnf

  7. With DNF on your system, you no longer need YUM. It’s time to remove it.

    CentOS 7 remove YUM
    dnf -y remove yum yum-metadata-parser
    rm -Rf /etc/yum

  8. You’re now ready to upgrade your system using DNF.

    CentOS 7 DNF upgrade
    dnf -y upgrade

  9. Pull the new release package for CentOS 8, and install it with DNF. This will kick off the upgrade process to CentoOS 8.

    CentOS 8 install release package
    dnf -y upgrade http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm

  10. Do the same to upgrade the EPEL repository.

    CentOS 8 upgrade EPEL
    dnf -y upgrade yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

  11. Remove any temporary files that might be hanging around your system.

    CentOS 8 DNF clean system
    dnf clean all

  12. Remove the old kernel from CentOS 7.

    rpm -e --nodeps `rpm -q kernel`
  13. Then, remove the other system packages that will cause conflicts.

    rpm -e --nodeps sysvinit-tools
  14. It’s time to upgrade the rest of the system. Use DNF to upgrade everything.

    CentOS 8 upgrade complete
    dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

  15. There’s a good chance that something broke. That’s fine. Take a look at the error message. Locate the offending package in the message, and uninstall it like you did the kernel with:

    rpm -e --nodeps <packagename>

    You may want to write down the package, so you can reinstall it after the upgrade. Then, re-run the previous step.

  16. Now, reinstall the kernel.

    dnf -y install kernel-core

  17. Finally, update the core of the operating system to ensure everything’s there and current.

    CentOS 8 core package install
    dnf -y groupinstall “Core” “Minimal Install”

  18. Check to see that the install succeeded.

    CentOS 8 release info
cat /etc/redhat-release