How to Upgrade Centos 7 to 8

On this page

  1. CentOS 7 to 8 Upgrade

CentOS 8 has been released on Sep 23rd, 2019 ISO's are available on the official website and could be installed in many ways, unfortunately, the minimal version is not available yet (or at all) as a SysAdmin it was my favorite build about 800 Mb compared to 6 Go, in this tutorial I will show you how to upgrade from Centos 7 to Centos 8

Please consider that this is not an official upgrade so it's not suitable for a production environment.

CentOS 7 to 8 Upgrade

Download and install EPEL repository:

yum -y install

Install yum-utils:

yum -y install rpmconf yum-utils

Resolving rpm packages:

rpmconf -a


Result of rpmconf command

Keep Default.

Cleanup packages we don't need.

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


Package cleanup

Install an RPM-based software DNF package manager :

yum -y install dnf


Removing yum package manager:

dnf -y remove yum yum-metadata-parser
rm -Rf /etc/yum

Updating a system with DNF:

sudo dnf -y upgrade

Installing the new version:

dnf -y upgrade

Upgrading EPEL repository:

dnf -y upgrade

Cleaning full temporary files kept on the repository

dnf clean all

removing kernels

rpm -e `rpm -q kernel`

Removing conflicting

rpm -e --nodeps sysvinit-tools

Now we launch the upgrade

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

Processing new configuration:

rpmconf -a

Confirm that new kernel-core is properly installed:

rpm -e kernel-core
dnf -y install kernel-core

Confirm that grub is updated and in the right place

ROOTDEV=`ls /dev/*da|head -1`;
echo "Detected root as $ROOTDEV..."
grub2-install $ROOTDEV

Install Minimal package:

dnf -y groupupdate "Core" "Minimal Install"

Check Centos version:

cat /etc/centos-release

CentOS Upgraded successfully

CentOS Boot screen

Share this page:

Suggested articles

21 Comment(s)

Add comment


By: Chucho

[[email protected] osboxes]# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync --skip-brokenLast metadata expiration check: 0:07:38 ago on Sun 10 Nov 2019 03:09:39 AM EST.Error:  Problem: The operation would result in removing the following protected packages: kernel[[email protected] osboxes]#

By: AmineYC

Hi Chucho, I did a test and it still works for me (regarding links), maybe you miss a step.

the error message is: Removing the protected package which is KERNEL. did you run: rpm -e `rpm -q kernel`, to install the new one after upgrading.


rpm -e `rpm -q kernel`

dnf -y install kernel-core

to install the new one?

Hope this will help you.

By: Terry Spearman

Other websites I've seen regarding upgrading Centos 7 to Centos 8 have said that there probably never will be an upgrade utility and the only way to upgrade is to do a clean install of Centos 8.  This looks like a much better option, but I'm reluctant to try it in case it goes wrong.  I'd be extremely interested to learn if others have tried the method described here and what their experience with it has been.

By: Chucho linux

[SKIPPED] yelp-xsl-3.28.0-2.el8.noarch.rpm: Already downloaded                                                     [SKIPPED] zenity-3.28.1-1.el8.x86_64.rpm: Already downloaded                                                       Running transaction checkError: transaction check vs depsolve:(annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarchrpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-116-1.el8.0.1.noarchTo diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue.The downloaded packages were saved in cache until the next successful transaction.You can remove cached packages by executing 'dnf clean packages'.

By: Carsten

same for me:

dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync ->> your error (german so i wont post the text) apart from that the upgrade seems to be working, /etc/redhead-release changed from 

CentOS Linux release 7.7.1908 (Core)


CentOS Linux release 8.0.1905 (Core)


By: stafwag

I had the same issue. To resolve it I ended up removing gcc and all devel packages

#rpm -qa | grep -i devel | xargs -n 1 dnf remove -y

Still needed to remove some other packages, but after that the upgrade was fine...

By: Amr

You are a life saver, thank you!

By: George

Thanks, worked perfectly! A bit scary to do on a remote machine, but it quickly came up again after reboot :)

By: DrMartinus

I tend to do the upgrade, because I do not know how to make sure that all data and configuration is secured and can be replayed without a lot of trouble. If it really ends up in setting everything up from scratch (because CentOS doesn't support an upgrade but requires a new installation), that would be awful. For now, I keep CentOS 7 and hope that some more people report success here, before I go ahead.

Unfortunately, my vserver-provider didn't allow the installation of a rolling release, else I would have chosen that when setting up the system.

By: perolator

Upgrade was successful. Run the steps and worked.

[[email protected] ~]# cat /etc/centos-releaseCentOS Linux release 8.0.1905 (Core)


By: Jobst

Can I ask the people who have done the upgrade what the release version was BEFORE update, please?I have heard that beginning 7.7 this is NOT possible anymore. Also have people done this on production systems?

By: SquirelMonkeyRock

I received a bunch of errors about kernel being a protected kernel when trying to remove the old kernel. Regardless of the errors I went throught the steps and see  Centos 8 when running cat /etc/centos-releaseCentOS however uname -r shows a 3.10 kernel version.

By: rsherman

have fun with your zombie systems!

By: Tuan ng

thanks, but it doesnt work at the moment the new release is this one on centos-release-8.1-1.1911.0.8.el8.x86_64.rpm . The upgrade just stop at "dnf -y upgrade"

[[email protected] ~]# cat /etc/centos-release CentOS Linux release 7.7.1908 (Core)

[[email protected] ~]# dnf -y upgrade Last metadata expiration check: 1:33:06 ago on Sun 26 Jan 2020 12:15:03 PM CET. centos-release-8.1-1.1911.0.8.el8.x86_64.rpm 78 kB/s | 21 kB 00:00 Dependencies resolved.

Problem: cannot install the best update candidate for package centos-release-7-7.1908.0.el7.centos.x86_64 – nothing provides centos-gpg-keys = 8.1-1.1911.0.8.el8 needed by centos-release-8.1-1.1911.0.8.el8.x86_64 – nothing provides centos-repos = 8.1-1.1911.0.8.el8 needed by centos-release-8.1-1.1911.0.8.el8.x86_64 ======================================================================================================================================================================== Package Arch Version Repository Size ======================================================================================================================================================================== Skipping packages with broken dependencies: centos-release x86_64 8.1-1.1911.0.8.el8 @commandline 21 k

Transaction Summary ======================================================================================================================================================================== Skip 1 Package

Nothing to do. Complete! [[email protected] ~]# [[email protected] ~]#

I try:


[[email protected] ~]# rpm -ivh Retrieving warning: /var/tmp/rpm-tmp.futBz3: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY error: Failed dependencies: centos-release < 8.0-0.1905.0.10 conflicts with centos-gpg-keys-8.1-1.1911.0.8.el8.noarch [[email protected] ~]#

By: Dmitry

Use this link

By: Jason

Even better is to use centos vault. That never changes. Mirrors are not guaranteed to keep previous releases.

By: Edson

Thanks, This one works for me

By: dM

Hi, this is not working.My kernel is: 3.10.0-1062.12.1.el7.x86_64CentOS Linux release 7.7.1908 (Core)

[[email protected] ~]# rpm -e `rpm -q kernel`

error: package package is not installed

error: package kernel is not installed

error: package is is not installed

error: package not is not installed

error: package installed is not installed

[[email protected] ~]# dnf -y install kernel-core

Failed to set locale, defaulting to C

Last metadata expiration check: 0:04:51 ago on Sun Feb  9 22:18:31 2020.

No match for argument: kernel-core

Error: Unable to find a match: kernel-core

By: Duilio

 I'm trying to upgrade centos, but I'm having problems after# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-syncError: transaction check vs depsolve:(gcc >= 8 with gcc < 9) is needed by annobin-8.78-1.el8.x86_64rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-8.78-1.el8.x86_64(annobin if gcc) is needed by redhat-rpm-config-120-1.el8.noarchrpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-120-1.el8.noarchTo diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.I tried : # dnf remove redhat-rpm-configand also removed the package with issues in #  rpm -Va --nofiles --nodigestand after that I did # rpm --rebuilddbBut, same problem.Tried:   # dnf clean packagesTried again # dnf remove redhat-rpm-config     and got:   No match for argument: redhat-rpm-config   No packages marked for removal.  Tried also  # dnf remove redhat-rpm-config-120-1.el8.noarchbut still same problem.Any help for what is the problem ?

By: Hussain

At the step "dnf -y upgrade", I get a 404. This is becuase the release numbers keep getting updated and previous files are removed.


Go to and copy/paste the links for three packages instead:

centos-release, centos-repos, centos-gpg-keys

By: Fernando

if error at dnf -y upgrade cannot install the best update candidate for package centos-release-7-8.2003.0.el7.centos.x86_64- nothing provides centos-gpg-keys = 8.1-1.1911.0.9.el8 needed by centos-release-8.1-1.1911.0.9.el8.x86_64- nothing provides centos-repos = 8.1-1.1911.0.9.el8 needed by centos-release-8.1-1.1911.0.9.el8.x86_64then usednf upgrade -y{centos-release-8.1-1.1911.0.8.el8.x86_64.rpm,centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm,centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm}found at www centlinux com /2020/01/how-to-upgrade-centos-7-to-8-server.html