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 https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install yum-utils:

yum -y install rpmconf yum-utils

Resolving rpm packages:

rpmconf -a

result:

Result of rpmconf command

Keep Default.

Cleanup packages we don't need.

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

result:

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 http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm

Upgrading EPEL repository:

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

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

7 Comment(s)

Add comment

Comments

By: Chucho at: 2019-11-10 08:19:37

[[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 at: 2019-11-12 15:17:06

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.

and: 

rpm -e `rpm -q kernel`

dnf -y install kernel-core

to install the new one?

Hope this will help you.

By: Terry Spearman at: 2019-11-12 21:18:30

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 at: 2019-11-13 03:22:07

[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 at: 2019-11-14 09:14:58

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)

to

CentOS Linux release 8.0.1905 (Core)

 

By: George at: 2019-11-15 00:59:31

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

By: DrMartinus at: 2019-11-15 15:55:21

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.