How to Upgrade CentOS 7 to CentOS 8 Linux

In this article, you will learn how to upgrade CentOS 7 to CentOS 8.5 release. The steps described herein do not depict the official upgrade and this should not be applied to a production server yet.

Step 1: Install the EPEL Repository

To start off, install the EPL repository by running:

# yum install epel-release -y
Install EPEL Repo in CentOS 7
Install EPEL Repo in CentOS 7

Step 2: Install yum-utils Tools

After successfully installing EPEL, install yum-utils by running the command below.

# yum install yum-utils
Install yum-utils in CentOS 7
Install yum-utils in CentOS 7

Thereafter, you need to resolve RPM packages by executing the command.

# yum install rpmconf
# rpmconf -a
Keep Default RPM Settings
Keep Default RPM Settings

Next, perform a clean-up of all the packages you don’t require.

# package-cleanup --leaves
# package-cleanup --orphans
Clean RPM Packages
Clean RPM Packages

Step 3: Install the dnf in CentOS 7

Now install the dnf package manager which is the default package manager for CentOS 8.

# yum install dnf
Install dnf in CentOS 7
Install dnf in CentOS 7

You also need to remove the yum package manager using the command.

# dnf -y remove yum yum-metadata-parser
# rm -Rf /etc/yum
Remove Yum in CentOS 7
Remove Yum in CentOS 7

Step 4: Upgrading CentOS 7 to CentOS 8

We are now ready to upgrade CentOS 7 to CentOS 8, but before we do so, upgrade the system using the newly install dnf package manager.

# dnf upgrade
Upgrade CentOS 7
Upgrade CentOS 7

Next, install CentOS 8 release package using dnf as shown below. This will take a while.

# dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}

Note: CentOS 8 is dead and all the repos have been moved to vault.centos.org.

Install CentOS 8 Release Packages
Install CentOS 8 Release Packages

Next, upgrade the EPEL repository.

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

After successfully upgrading the EPEL repository, remove all the temporary files.

# dnf clean all

Remove the old kernel core for CentOS 7.

# rpm -e `rpm -q kernel`
Remove Old CentOS 7 Kernel
Remove Old CentOS 7 Kernel

Next, be sure to remove conflicting packages.

# rpm -e --nodeps sysvinit-tools

Thereafter, launch the CentOS 8 system upgrade as shown.

# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
CentOS 8 System Upgrade
CentOS 8 System Upgrade

Note: If you get errors about conflicting packages, for example in my case there were conflicts about the existing python36-rpmconf package. I removed this package, similarly if you get any conflicts just remove those packages and try running the above upgrade command.

Step 5: Install the New Kernel Core for CentOS 8

To install a new kernel for CentOS 8, run the command.

# dnf -y install kernel-core
Install Kernel in CentOS 8
Install Kernel in CentOS 8

Finally, install CentOS 8 minimal package.

# dnf -y groupupdate "Core" "Minimal Install"

Now you can check the version of CentOS installed by running.

# cat /etc/redhat-release
Check CentOS Version
Check CentOS Version

If you see the above output, I have successfully upgraded from CentOS 7 to CentOS 8.5 release.

Read Also: How to Set Up Automatic Updates for CentOS 8

Conclusion

This article concludes on how you can upgrade from CentOS 7 to CentOS 8. We hope you found this insightful.

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

242 thoughts on “How to Upgrade CentOS 7 to CentOS 8 Linux”

  1. Hi,

    I got this issue when trying to sync the package with Centos 8.

    # dnf --releasever=8 --setopt=deltarpm=false --setopt=protected_packages=  distro-sync -y
    
    CentOS Linux 8 - BaseOS
    CentOS Linux 8 - AppStream
    Failed to synchronize cache for repo 'baseos', ignoring this repo.
    Failed to synchronize cache for repo 'appstream', ignoring this repo.
    Last metadata expiration check: 1:02:50 ago on Mon 04 Mar 2024 12:31:47 AM EST.
    Error: 
     Problem: problem with installed package libssh2-1.8.0-4.el7_9.1.aarch64
      - libssh2-1.8.0-4.el7_9.1.aarch64 does not belong to a distupgrade repository
      - nothing provides libcrypto.so.1.1()(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libssl.so.1.1()(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by libssh2-1.10.0-1.el8.aarch64
    
    # dnf distro-sync
    
    CentOS Linux 8 - BaseOS            
    CentOS Linux 8 - AppStream         
    Failed to synchronize cache for repo 'baseos', ignoring this repo.
    Failed to synchronize cache for repo 'appstream', ignoring this repo.
    Last metadata expiration check: 1:06:38 ago on Mon 04 Mar 2024 12:31:47 AM EST.
    Error: 
     Problem: problem with installed package libssh2-1.8.0-4.el7_9.1.aarch64
      - libssh2-1.8.0-4.el7_9.1.aarch64 does not belong to a distupgrade repository
      - nothing provides libcrypto.so.1.1()(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libssl.so.1.1()(64bit) needed by libssh2-1.10.0-1.el8.aarch64
      - nothing provides libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) needed by libssh2-1.10.0-1.el8.aarch64
    

    And when I tried to remove the package libssh2, this is what I got:

    # dnf remove libssh2
    
    Error: 
     Problem: The operation would result in removing the following protected packages: systemd
    

    Is there any ideas to fix this?

    Reply
    • @Thuy,

      You have libssh2-1.8.0-4.el7_9.1.aarch64 installed, which belongs to CentOS Linux 7 repository, which isn’t compatible with your CentOS 8 system.

      Updating it to the latest libssh2 version might fix the issue.

      sudo sudo dnf update
      sudo dnf update libssh2
      
      Reply
  2. Hi,

    Thanks for the guide. I’ve been doing distro upgrades since Redhat 7.3 to RedHat 9/RHEL 3 almost twenty years ago so I’m pretty well versed in these. However, I’ve ran into an issue after doing my first upgrade. dnf/yum runs out of memory when trying to do the epel repo (see below).

    This happens even if I raise the memory limit to 8GB of RAM and almost all of it is free.

    Do you know what is tripping this up? I’m sure its some limit setting somewhere.

    # dnf update
    
    AlmaLinux 8 - BaseOS                                                                                                         10 MB/s | 2.9 MB     00:00
    AlmaLinux 8 - AppStream                                                                                                      24 MB/s | 9.8 MB     00:00
    Out of memory allocating 16777216 bytes!
    Aborted (core dumped)
    
    Reply
  3. I have CentOS 7.9 and your guide for me fails at this point.

    [root@CentOS-73-64-minimal ~]# yum install -y leapp-upgrade leapp-data-almalinux

    –> Finished Dependency Resolution
    Error: Package: 1:leapp-upgrade-el7toel8-0.16.0-6.el7.elevate.17.noarch (elevate)
    Requires: python2-leapp
    Error: Package: 1:leapp-upgrade-el7toel8-deps-0.16.0-6.el7.elevate.17.noarch (elevate)
    Requires: python-requests
    Error: Package: 1:leapp-upgrade-el7toel8-deps-0.16.0-6.el7.elevate.17.noarch (elevate)
    Requires: dnf >= 4
    Error: Package: leapp-0.14.0-1.el7.noarch (elevate)
    Requires: python2-leapp = 0.14.0-1.el7
    Error: Package: 1:leapp-upgrade-el7toel8-0.16.0-6.el7.elevate.17.noarch (elevate)
    Requires: leapp-framework >= 2.2
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    Any idea to solve this ?

    Reply
    • @Graziano,

      The error message you’re encountering indicates that there are several unmet dependencies when trying to install the leapp-upgrade and leapp-data-almalinux packages.

      To fix this issue, you can follow below steps:

      1. Ensure your system is up to date:

      sudo yum update
      

      2. To satisfy the dependencies, you can try installing the required packages one by one:

      sudo yum install python2-leapp
      sudo yum install python-requests
      

      3. For the dnf >= 4 requirement, you may need to update or install DNF:

      sudo yum install dnf
      

      4. You can try installing leapp-framework with the specified version:

      sudo yum install leapp-framework-2.2
      

      5. After resolving these dependencies, try installing leapp-upgrade and leapp-data-almalinux again:

      sudo yum install -y leapp-upgrade leapp-data-almalinux
      

      If you encounter any additional dependency issues during this process, make sure to address them as well. If there are conflicts or issues that cannot be resolved, you may need to contact the package maintainers or the repository maintainers for assistance, as they might need to update their packages to resolve the dependencies.

      Reply
  4. Hello, I’m stuck in a several problems. Yum didn’t work. Dnf is not installed. All this problems happen before this step

    # dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
    

    There was a problem importing one of the Python modules required to run yum.

    The error leading to this problem was:

    /usr/lib64/python2.7/site-packages/pycurl.so: undefined symbol: CRYPTO_num_locks
    

    Please install a package which provides this module, or verify that the module is installed correctly.

    It’s possible that the above module doesn’t match the current version of Python, which is:

    2.7.5 (default, Jun 20 2023, 11:36:40) 
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
    

    If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq

    Maybe is time to say goodbye to centos………

    Reply
    • @Pablo,

      The error message you mentioned indicates that there is an issue with the pycurl module in your Python installation, which appears that there is a missing or incompatible symbol related to OpenSSL’s CRYPTO_num_locks function.

      Try reinstalling the pycurl (python-pycurl) module to ensure that you have the latest version that is compatible with your updated OpenSSL.

      # yum install python-pycurl
      OR
      # dnf install python-pycurl
      
      Reply
  5. For me, it ends like in the above comment:

    # dnf --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    CentOS Linux 8 - BaseOS                                                                                      
    CentOS Linux 8 - AppStream    
    Failed to synchronize cache for repo 'baseos', ignoring this repo.
    Failed to synchronize cache for repo 'appstream', ignoring this repo.
    Last metadata expiration check: 0:01:07 ago on 2023-01-15T13:39:04 UTC.
    Error: 
     Problem: The operation would result in removing the following protected packages: dnf
    
    Reply
    • @Martin,

      It seems like you’re encountering an issue with the DNF package manager on CentOS 8, to fix this issue you can try the following steps:

      1. Update the DNF package to the latest version available in the repository.

      sudo dnf update dnf
      

      2. After updating DNF, try running the system update again.

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

      If the issue persists, you may try reinstalling the ‘dnf’ package:

      sudo dnf reinstall dnf
      

      If the problem is related to dependencies, you may need to address those dependencies before attempting the update.

      Reply
  6. I am stuck in this:

    (700/701): ntfs-3g-2022.10.3-1.el8.x86_64.rpm                    459 kB/s | 133 kB     00:00
    (701/701): ntfsprogs-2022.10.3-1.el8.x86_64.rpm                  1.2 MB/s | 404 kB     00:00
    -----------------------------------------------------------------------------------------------
    Total                                                            649 kB/s | 724 kB     00:01
    Running transaction check
    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-9.72-1.el8_5.2.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-9.72-1.el8_5.2.x86_64
    (annobin if gcc) is needed by redhat-rpm-config-125-1.el8.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-125-1.el8.noarch
    To 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'.
    
    Reply
  7. Hi Ravi, I am having issues when I try to – Next, install CentOS 8 release package using dnf as shown below. This will take a while.


    # dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
    CentOS-7 - Base 0.0 B/s | 0 B 00:00
    CentOS-7 - Updates 0.0 B/s | 0 B 00:00
    CentOS-7 - Extras 0.0 B/s | 0 B 00:00
    Failed to synchronize cache for repo 'base', ignoring this repo.
    Failed to synchronize cache for repo 'updates', ignoring this repo.
    Failed to synchronize cache for repo 'extras', ignoring this repo.
    Last metadata expiration check: 0:01:24 ago on Thu 02 Feb 2023 04:42:15 PM UTC.
    [MIRROR] centos-linux-repos-8-3.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]
    [FAILED] centos-linux-repos-8-3.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]
    Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]

    Any suggestions/thoughts?

    Thanks
    Sunil

    Reply
      • Thanks, Ravi!

        Changed the time and time zone. Now I am unable to remove the old kernel and also unable to upgrade the kernel version.

        $  rpm -e `rpm -q kernel`
        
        error: Failed dependencies:
                kernel >= 2.6.32 is needed by (installed) lldpad-1.0.1-7.git036e314.el7_9.x86_64
                kernel >= 2.6.32 is needed by (installed) lldpad-1.0.1-7.git036e314.el7_9.x86_64
        
        [root]# dnf -y install kernel-core
        CentOS-7 - Base                                                                                                              
        CentOS-7 - Updates                                                                                                       
        CentOS-7 - Extras                                                                                                        
        Failed to synchronize cache for repo 'base', ignoring this repo.
        Failed to synchronize cache for repo 'updates', ignoring this repo.
        Failed to synchronize cache for repo 'extras', ignoring this repo.
        Last metadata expiration check: 0:01:55 ago on Mon 06 Feb 2023 11:54:47 AM EST.
        No match for argument: kernel-core
        Error: Unable to find a match: kernel-core
        

        Any help here
        Thanks
        Sunil

        Reply
        • @Sunil,

          There could be three reasons for getting a such error:

          1. Incorrect date and time settings
          2. Old dnf cache expired
          3. CentOS baseURL

          Fix these issues by:

          # timedatectl set-timezone "Asia/Kolkata"
          # dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
          # dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
          # dnf clean all
          # rpm -e `rpm -q kernel`
          
          Reply
          • Hi Ravi, The server is in USA EST, so I set it to EST time.

            Still getting the same error –

            [root@~]# date
            Tue Feb  7 10:06:07 EST 2023
            


            [root@c~]# dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
            CentOS-7 - Base 0.0 B/s | 0 B 00:00
            CentOS-7 - Updates 0.0 B/s | 0 B 00:00
            CentOS-7 - Extras 0.0 B/s | 0 B 00:00
            Failed to synchronize cache for repo 'base', ignoring this repo.
            Failed to synchronize cache for repo 'updates', ignoring this repo.
            Failed to synchronize cache for repo 'extras', ignoring this repo.
            Last metadata expiration check: 22:11:40 ago on Mon 06 Feb 2023 11:54:47 AM EST.
            [MIRROR] centos-linux-repos-8-3.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]
            [FAILED] centos-linux-repos-8-3.el8.noarch.rpm: Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]
            Curl error (56): Failure when receiving data from the peer for http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm [Recv failure: Connection reset by peer]

          • @Sunil,

            It seems your curl doesn’t support SSL/TLS properly. Try to update or upgrade your system with:

            $ dnf update
            $ dnf upgrade
            
          • Hi Ravi, Still no luck

            [root@INDPCS ~]# dnf update
            CentOS-7 - Base                                 0.0  B/s |   0  B     00:00
            CentOS-7 - Updates                              0.0  B/s |   0  B     00:00
            CentOS-7 - Extras                               0.0  B/s |   0  B     00:00
            Failed to synchronize cache for repo 'base', ignoring this repo.
            Failed to synchronize cache for repo 'updates', ignoring this repo.
            Failed to synchronize cache for repo 'extras', ignoring this repo.
            Last metadata expiration check: 16:13:48 ago on Tue 07 Feb 2023 04:02:13 PM EST.
            Dependencies resolved.
            Nothing to do.
            Complete!
            
            [root@INDPCS ~]# dnf upgrade
            CentOS-7 - Base                                 0.0  B/s |   0  B     00:00
            CentOS-7 - Updates                              0.0  B/s |   0  B     00:00
            CentOS-7 - Extras                               0.0  B/s |   0  B     00:00
            Failed to synchronize cache for repo 'base', ignoring this repo.
            Failed to synchronize cache for repo 'updates', ignoring this repo.
            Failed to synchronize cache for repo 'extras', ignoring this repo.
            Last metadata expiration check: 16:14:10 ago on Tue 07 Feb 2023 04:02:13 PM EST.
            Dependencies resolved.
            Nothing to do.
            

            Complete!
            [root@INDPCS ~]#

          • @Sunil,

            It looks like your repos are empty, I suggest you check the repos in /etc/yum.repos.d/ directory and see the sizes of the base, updates, and extras repository. Also, I suggest your to try to follow the instructions again from the beginning…

  8. Hello,

    Thanks for the instructions. It did seem easy enough to follow and worked well until:

    # dnf --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    CentOS Linux 8 - BaseOS                                                                                      
    CentOS Linux 8 - AppStream    
    Failed to synchronize cache for repo 'baseos', ignoring this repo.
    Failed to synchronize cache for repo 'appstream', ignoring this repo.
    Last metadata expiration check: 0:01:07 ago on 2023-01-15T13:39:04 UTC.
    Error: 
     Problem: The operation would result in removing the following protected packages: dnf
    

    Google then took me to either irrelevant or highly complex and problematic pages… I’m going to revert my snapshot for maybe another try later.

    Reply
    • Uninstall dnf from the centos7 install before starting. Centos7 dnf uses python2, when following the process above the installation of dnf in order should pull a python3 version for you.

      Reply
    • I had the same issue and kept trying different things.

      The solution I found was to search for the newest repositories from the CentOS 8 Stream and use this when installing the CentOS 8 repos:

      # dnf install http://http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/{centos-stream-repos-8-6.el8.noarch.rpm,centos-stream-release-8.6-1.el8.noarch.rpm,centos-gpg-keys-8-6.el8.noarch.rpm}
      

      After removing the old kernel I needed to remove the old python-pip package since this will conflict with other packages moving forward.

      Then I manually installed “NetworkManager” before executing:

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

      Hopefully, this helps.

      Reply
  9. Hi,

    I followed the procedure but at this stage:

    # dnf -y install kernel-core
    

    I’m getting the error:

    No match for argument: kernel-core
    Error: Unable to find a match: kernel-core.
    

    My kernel version after running command uname -r:

    3.10.0-957.el7.x86_64
    

    Any idea appreciated.

    Reply
    • @Cyrus,

      To fix this problem you need to boot into rescue mode, then remove the existing linux-firmware package and then manually download and install kernel, kernel-core, and kernel-modules, linux-firmware using rpm -ivh kernel* command.

      After that reboot the machine…

      Reply
  10. @Ravi Saive,

    Works with that long sequence. I am somehow able to rpm -ivh kernel-modules after removing a lot of packages related to python3 maybe. Able to show and boot into Centos 8. But since I was deep with a lot of packages in CentOs 7, after doing a lot of dnf removal.

    I ended up missing some crucial utilities after booting into CentOS 8. Ended up just reinstalling a CentOS 8. Was never able to run:

    # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    
    Reply
    • @John,

      Sorry for the trouble, but I think you can install those missing utilities with dnf tool after booting into CentOS 8…

      Reply
  11. Before yum install rpmconf do yum update, that will allow you to fix the issue with the error: import error: no module named _conf on step 3 ending.

    Reply
  12. Just FYI, I followed this blueprint to do an in-place upgrade from CentOS 8-Stream to 9-Stream. The biggest difference is that the CentOS 9-Stream mirrors are in a different place (you can find them on Mirror Manager). Otherwise, the above process worked pretty well and I had surprisingly few issues getting CentOS 9 up and running.

    Reply
  13. The command # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync fails. It will try to remove the protected dnf package.

    Adding --setopt=protected_packages= is a really bad idea, because dnf is removed by itself.

    Then you have a system without dnf, yum, or rpm. Not recommended!

    Reply
  14. How to upgrade CentOS 7.9 to CentOS 8.5

    Type all the commands as root.

    # yum install epel-release -y
    # yum install yum-utils
    # yum install rpmconf
    # rpmconf -a
    

    Answer the questions using the default. Usuallly it is N, in httpd case it is Y.

    # package-cleanup --leaves
    # package-cleanup --orphans
    # yum install dnf
    # dnf -y remove yum yum-metadata-parser
    # rm -Rf /etc/yum
    # dnf upgrade
    # dnf install http://vault.centos.org/8.5.2111/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-3.el8.noarch.rpm,centos-linux-release-8.5-1.2111.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}
    # dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm --best --allowerasing
    # dnf clean all
    # rpm -e `rpm -q kernel`
    # rpm -e --nodeps sysvinit-tools
    # dnf remove kexec-tools
    # dnf remove ivtv-firmware
    # dnf remove linux-firmware
    # cd /root
    # wget http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-4.18.0-348.el8.x86_64.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-modules-4.18.0-348.el8.x86_64.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-core-4.18.0-348.el8.x86_64.rpm
    # rpm -iv linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
    # rpm -iv kernel-modules-4.18.0-348.el8.x86_64.rpm
    # cp /lib/modules/4.18.0-348.el8.x86_64/symvers.gz /boot/
    # cd /boot 
    # mv symvers.gz symvers-4.18.0-348.el8.x86_64.gz
    # cd /root
    # rpm -iv --replacepkgs kernel-core-4.18.0-348.el8.x86_64.rpm
    # rpm -iv kernel-4.18.0-348.el8.x86_64.rpm
    # cat /etc/redhat-release
    # reboot
    

    Check during the boot process is everything ok. Should be OK.

    # dnf check-update
    # dnf update nameofthepackage --best --allowerasing
    

    ———————– this is not fixed by me yet ———————————————
    libssh2.x86_64 – this is not possible to be upgraded just because the problem is that it will not let the dnf package be removed

    Dependencies described here:
    http://rpm.pbone.net/info_idpl_75792859_distro_redhatel8_com_libssh2-1.9.0-5.el8.x86_64.rpm.html

    Seems this is a huge dependencies issue, just because all those four libraries are not enough

    # wget https://download-ib01.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/l/libssh2-1.9.0-5.el8.x86_64.rpm
    # rpm -Uivh libssh2-1.9.0-5.el8.x86_64.rpm
    error: Failed dependencies:
            libcrypto.so.1.1()(64bit) is needed by libssh2-1.9.0-5.el8.x86_64
            libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) is needed by libssh2-1.9.0-5.el8.x86_64
            libcrypto.so.1.1(OPENSSL_1_1_1)(64bit) is needed by libssh2-1.9.0-5.el8.x86_64
            libssl.so.1.1()(64bit) is needed by libssh2-1.9.0-5.el8.x86_64
    

    If you will try to download this one for CentOS 8 that contains all four libraries.

    # wget https://vault.centos.org/8.1.1911/BaseOS/x86_64/os/Packages/openssl-libs-1.1.1c-2.el8_1.1.x86_64.rpm
    

    And then if you will try to install it with this command:

    # rpm -iv openssl-libs-1.1.1c-2.el8_1.1.x86_64.rpm
    

    It will show these dependencies for example below. So a big surprise.

    crypto-policies >= 20180730 is needed by openssl-libs-1:1.1.1c-2.el8_1.1.x86_64

    So

    # wget https://vault.centos.org/8.5.2111/BaseOS/x86_64/kickstart/Packages/krb5-libs-1.18.2-14.el8.x86_64.rpm
    # rpm -iv krb5-libs-1.18.2-14.el8.x86_64.rpm
    
    warning: krb5-libs-1.18.2-14.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 8483c65d: NOKEY
    error: Failed dependencies:
            /etc/crypto-policies/back-ends/krb5.config is needed by krb5-libs-1.18.2-14.el8.x86_64
            libc.so.6(GLIBC_2.25)(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libc.so.6(GLIBC_2.27)(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libcrypto.so.1.1()(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libcrypto.so.1.1(OPENSSL_1_1_0)(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libcrypto.so.1.1(OPENSSL_1_1_1b)(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libssl.so.1.1()(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            libssl.so.1.1(OPENSSL_1_1_0)(64bit) is needed by krb5-libs-1.18.2-14.el8.x86_64
            openssl-libs >= 1:1.1.1c-4 is needed by krb5-libs-1.18.2-14.el8.x86_64
    

    Maybe it is possible to solve it by you know, checking which library has to be downloaded first and then downloading and installing them one by one in the correct order. Some day maybe will find out is it possible, but I am not sure.

    Reply
  15. Thereafter, launch the CentOS 8 system upgrade as shown.

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

    This will fail. So, instead of the above do the below without reboot:

    # dnf remove kexec-tools
    # dnf remove ivtv-firmware
    # dnf remove linux-firmware
    # cd /root
    # wget http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/Packages/linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-4.18.0-348.el8.x86_64.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-modules-4.18.0-348.el8.x86_64.rpm
    # wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-core-4.18.0-348.el8.x86_64.rpm
    # rpm -iv linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
    # rpm -iv kernel-modules-4.18.0-348.el8.x86_64.rpm
    # cp /lib/modules/4.18.0-348.el8.x86_64/symvers.gz /boot/
    # cd /boot 
    # mv symvers.gz symvers-4.18.0-348.el8.x86_64.gz
    # cd /root
    # rpm -iv --replacepkgs kernel-core-4.18.0-348.el8.x86_64.rpm
    # rpm -iv kernel-4.18.0-348.el8.x86_64.rpm
    # cat /etc/redhat-release
    # reboot
    

    Check during the boot process is everything ok. Should be.

    Reply
  16. Replace:
    # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    with:

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

    Reply
  17. Running operation verification
    Error: operation verification vs depsolve:
    (NetworkManager >= 1.20 or dhclient) is needed by dracut-network-049-201.git20220131.el8.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by dracut-network-049-201.git20220131.el8.x86_64
    To detect the problem, try running: 'rpm -Va –nofiles –nodigest'.
    You probably have a corrupted RPMDB, running 'rpm –rebuilddb' might fix the problem.
    The downloaded packages have been cached for the next transaction.
    You can clear packages from cache by removing 'dnf clean packages'.

    Reply
  18. Unfortunately, the vault.centos.org repo for CentOS 8 is out, too.

    I just skipped CentOS entirely and From CentOS 7 I upgraded directly to CentOS 8 Stream using

    dnf install --allowerasing http://mirrors.advancedhosters.com/centos/8-stream/BaseOS/x86_64/os/Packages/{centos-stream-repos-8-3.el8.noarch.rpm,centos-stream-release-8.6-1.el8.noarch.rpm,centos-gpg-keys-8-3.el8.noarch.rpm}

    along with a few adjustments.

    Reply
      • Confirm it works with vault repos or with stream repos.

        Did upgrade with both repos.

        In some cases you can’t remove kernels from working OS, so you should boot into recovery mode and do it manually.

        1. Download kernel, kernel-core and kernel-modules, linux-firmware.

        wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-4.18.0-348.el8.x86_64.rpm
        wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-modules-4.18.0-348.el8.x86_64.rpm
        wget https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/kernel-core-4.18.0-348.el8.x86_64.rpm
        

        2. Boot in rescue mode and remove existing linux-firmware package and install downloaded package.

        dnf remove kexec-tools
        dnf remove ivtv-firmware
        dnf remove linux-firmware
        

        3. Then Install kernel packages by (rpm -iv kernel*).

        rpm -iv linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
        rpm -iv kernel-modules-4.18.0-348.el8.x86_64.rpm
        /boot/symvers -> symlink /lib/moules/4.18…/symvers.gz
        rpm -iv --replacepkgs kernel-core-4.18.0-348.el8.x86_64.rpm
        rpm -e --nodeps sysvinit-tools
        rpm -q kernel-3.10.... (your kernels here)  and soft that depends on it
        

        5. Reboot.

        Reply
        • # rpm -iv linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm
          error: open of linux-firmware-20210702-103.gitd79c2677.el8.noarch.rpm failed: No such file or directory

          # rpm -iv kernel-modules-4.18.0-348.el8.x86_64.rpm
          error: Failed dependencies:
          kernel-uname-r = 4.18.0-348.el8.x86_64 is needed by kernel-modules-4.18.0-348.el8.x86_64

          # /boot/symvers -> symlink /lib/moules/4.18…/symvers.gz
          bash: /boot/symvers: No such file or directory

          Reply
  19. root@cerebro ~# dnf clean all
    71 files removed

    root@cerebro ~# rpm -e `rpm -q kernel`
    package `rpm is not installed
    package kernel` is not installed

    root@cerebro ~# rpm -e –nodeps sysvinit-tools

    root@cerebro ~# dnf -y –releasever=8 –allowerasing –setopt=deltarpm=false distro-sync
    Extra Packages for Enterprise Linux 8 – x86_64 16 MB/s | 11 MB 00:00
    CentOS Linux 8 – BaseOS 6.0 MB/s | 4.6 MB 00:00
    ELRepo.org Community Enterprise Linux Repository – el7 167 kB/s | 296 kB 00:01
    Nux.Ro RPMs for general desktop use 2.6 MB/s | 4.2 MB 00:01
    Extra Packages for Enterprise Linux Modular 8 – x86_64 1.3 MB/s | 979 kB 00:00
    Copr repo for snapcore-el7 owned by ngompa 46 kB/s | 27 kB 00:00
    CentOS Linux 8 – AppStream 1.9 MB/s | 8.4 MB 00:04
    CentOS Linux 8 – Extras 238 kB/s | 10 kB 00:00
    Error:
    Problem: The operation would result in removing the following protected packages: kernel

    How to fix it now?

    Reply
  20. THIS IS NOT A SUPPORTED METHOD TO UPGRADE !!

    Do NOT follow this or any other ‘upgrade‘ steps you find, as it will most likely fail unless you’re on a brand new system with almost nothing installed/configured to it, and you’ll end up with a very crippled machine that may not survive a reboot again without a full re-install.

    THIS IS NOT A SUPPORTED METHOD TO UPGRADE !!

    Reply
  21. I failed below:

    # yum install rpmconf
    

    It complained python conflict:

    ...
    file /usr/lib64/python3.6/xml/sax/__pycache__/xmlreader.cpython-36.pyc from install of python3-libs-3.6.8-18.el7.x86_64 conflicts with file from package python36u-libs-3.6.8-1.el7.ius.x86_64

    Reply
    • The kernel used for the server while it is running (on power) is in the RAM already. So even if you delete the rpm package of the Linux kernel (or any other running application, e.g. the ftp package on a running ftp server ) the server still is running BUT now you could not reboot it, because, after the reboot, the Linux kernel would not be found anywhere to be loaded in the RAM.

      So when the steps of the article are done, your server will still run with a kernel of centos7.9, and after a reboot, it will start with the kernel of 8.1, I hope I say it correctly. The article should have mentioned in the end to do a reboot.

      Reply
  22. Running transaction check
    Error: transaction check vs depsolve:
    (NetworkManager >= 1.20 or dhclient) is needed by dracut-network-049-191.git20210920.el8.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by dracut-network-049-191.git20210920.el8.x86_64
    To 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'.

    Reply
      • @ravi this command doesn’t help. I have the same issue as @fredo

        Firstly, yum has already been removed in one of the previous steps. Secondly, dracut-network is not installed and can’t be removed with either rpm or dnf.

        Reply
    • @Fredo I fixed the issue by running `rpm -Va --nofiles --nodigest` and removing all the packages with missing dependencies.

      In my case:

      # rpm -e kexec-tools
      # rpm -e python36-rpmconf-1.0.22-1.el7.noarch rpmconf-1.0.22-1.el7.noarch
      
      Reply
  23. dnf -y groupupdate "Core" "Minimal Install"
    Last metadata expiration check: 0:09:42 ago on Tuesday 23 November 2021 11:09:26 AM IST.

    No match for group package “rhc”
    Error:
    Problem 1: package dracut-049-191.git20210920.el8.x86_64 requires systemd >= 239-23, but none of the providers can be installed
    - package systemd-239-51.el8.i686 obsoletes systemd < 229-5 provided by systemd-219-78.el7_9.3.x86_64
    - cannot install both systemd-239-51.el8.x86_64 and systemd-219-78.el7_9.3.x86_64
    - package systemd-239-51.el8.x86_64 obsoletes systemd = 049-129, but none of the providers can be installed
    - package systemd-sysv-219-78.el7_9.3.x86_64 requires systemd = 219-78.el7_9.3, but none of the providers can be installed
    - conflicting requests
    - problem with installed package systemd-sysv-219-78.el7_9.3.x86_64

    Problem 2: package python3-hawkey-0.63.0-3.el8.x86_64 requires librpm.so.8()(64bit), but none of the providers can be installed
    - package python3-hawkey-0.63.0-3.el8.x86_64 requires librpmio.so.8()(64bit), but none of the providers can be installed
    - package python3-dnf-plugins-core-4.0.21-3.el8.noarch requires python3-hawkey >= 0.46.1, but none of the providers can be installed
    - cannot install both rpm-libs-4.14.3-19.el8.x86_64 and rpm-libs-4.11.3-46.el7_9.x86_64
    - package dnf-plugins-core-4.0.21-3.el8.noarch requires python3-dnf-plugins-core = 4.0.21-3.el8, but none of the providers can be installed
    - package deltarpm-3.6-3.el7.x86_64 requires librpm.so.3()(64bit), but none of the providers can be installed
    - package deltarpm-3.6-3.el7.x86_64 requires librpmio.so.3()(64bit), but none of the providers can be installed
    - conflicting requests
    - problem with installed package deltarpm-3.6-3.el7.x86_64

    Problem 3: package python3-dnf-4.7.0-4.el8.noarch requires dnf-data = 4.7.0-4.el8, but none of the providers can be installed
    - package dnf-4.7.0-4.el8.noarch requires python3-dnf = 4.7.0-4.el8, but none of the providers can be installed
    - cannot install both dnf-data-4.7.0-4.el8.noarch and dnf-data-4.0.9.2-2.el7_9.noarch
    - package yum-4.7.0-4.el8.noarch requires dnf = 4.7.0-4.el8, but none of the providers can be installed
    - package python2-dnf-4.0.9.2-2.el7_9.noarch requires dnf-data = 4.0.9.2-2.el7_9, but none of the providers can be installed
    - conflicting requests
    - problem with installed package python2-dnf-4.0.9.2-2.el7_9.noarch
    (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

    Reply
    • @Sai,

      Does the following command is successful? I suggest you re-run the following command and see if there are any package conflicts, if yes remove those conflicts and run the command again.

      # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
      
      Reply
  24. # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    Last metadata expiration check: 0:34:40 ago on Sun 14 Nov 2021 12:48:00 PM IST.
    Error:
    Problem: The operation would result in removing the following protected packages: kernel-plus

    Reply
  25. This guide while has good intentions should simply not be followed. It doesn’t cover handling dependencies and leaves out a few steps such as kernel modules being updated correctly. Historically, Red Hat has not pushed the idea that major upgrades are supported, and while it is possible, it’s only worth chasing if these steps are properly documented, which they clearly are not in this article.

    Reply
  26. On the last command, I added --skipbroken, because I could not resolve all dependencies.

    My question is, when you reboot, which kernel is supposed to boot up the system? With the command uname -r I still get 3.10.0-1160.36.2.el7.x86_64, old version.

    With:

    # dnf list installed kernel
    

    Installed Packages
    kernel.x86_64 3.10.0-1160.36.2.el7 @System
    kernel.x86_64 4.18.0-305.12.1.el8_4 @baseos

    Reply
      • Thanks for answering!

        What about the conflicts? How can I solve them because I cannot run update/upgrade commands?

        Here is part of what I get:

        file /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/upload.cpython-36.opt-1.pyc from install of platform-python-setuptools-39.2.0-6.el8.noarch conflicts with file from package python3-setup tools-39.2.0-10.el7.noarch
        file /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/upload.cpython-36.pyc from install of platform-python-setuptools-39.2.0-6.el8.noarch conflicts with file from package python3-setuptools- 39.2.0-10.el7.noarch
        file /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/upload_docs.cpython-36.opt-1.pyc from install of platform-python-setuptools-39.2.0-6.el8.noarch conflicts with file from package python3- setuptools-39.2.0-10.el7.noarch
        file /usr/lib/python3.6/site-packages/setuptools/command/__pycache__/upload_docs.cpython-36.pyc from install of platform-python-setuptools-39.2.0-6.el8.noarch conflicts with file from package python3-setupt ools-39.2.0-10.el7.noarch
        file /usr/lib64/libgdbm_compat.so.4.0.0 from install of gdbm-libs-1:1.18-1.el8.x86_64 conflicts with file from package gdbm-1.10-8.el7.x86_64

        Reply
  27. UPDATE: I cannot recommend this upgrade method. I have made some progress, but am still in dependency hell. I have done 'yum --best --allowerasing -x upgrade a* b*' and so on, iterating through the alphabet and adding packages that break the process.

    I still have a list I can’t upgrade, and still have a list that prevents distsync. I am concerned that any reboot will completely hose the system, especially as I run headless. I am on the verge of major surgery (removing mariadb, for example), but even then a dnf upgrade is required but I cannot do so because it is protected (and would require erasing). At this point, I need to sink $$$ into the project, build a completely new system, and migrate each package and config over piece by piece. Grr.

    Reply
    • The current output of distsync:

      rror: transaction check vs depsolve:
      (gcc >= 8 with gcc < 9) is needed by annobin-9.50-1.el8.x86_64
      rpmlib(RichDependencies) = 3:10.3.27 if mariadb) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
      (mariadb-connector-c-config = 3.1.11-2.el8_3 if mariadb-connector-c-config) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
      rpmlib(RichDependencies) <= 4.12.0-1 is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
      (ipa-selinux if selinux-policy-targeted) is needed by ipa-common-4.9.2-3.module_el8.4.0+780+c53619b9.noarch
      rpmlib(RichDependencies) <= 4.12.0-1 is needed by ipa-common-4.9.2-3.module_el8.4.0+780+c53619b9.noarch
      (annobin if gcc) is needed by redhat-rpm-config-125-1.el8.noarch
      rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-125-1.el8.noarch
      To 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'.

      Trying to install via DNF gives error "none of the providers can be installed" e.g:
      – package ipa-common-4.9.2-3.module_el8.4.0+780+c53619b9.noarch requires (ipa-selinux if selinux-policy-targeted), but none of the providers can be installed

      Reply
  28. In the last step:

    # dnf -y groupupdate "Core" "Minimal Install" 
    

    I get the following error:

    Running transaction check
    Error: transaction check vs depsolve:
    (mariadb >= 3:10.3.27 if mariadb) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    (mariadb-connector-c-config = 3.1.11-2.el8_3 if mariadb-connector-c-config) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    rpmlib(RichDependencies) = 1.20 or dhclient) is needed by dracut-network-049-135.git20210121.el8.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by dracut-network-049-135.git20210121.el8.x86_64

    I also tried the following command, but that didn't work either. Help because I'm stuck here.

    # dnf -y groupupdate "Core" "Minimal Install" --allowerasing
    
    Reply
  29. When running the distrosync, I get the following error(s):

    Running transaction check
    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-9.50-1.el8.x86_64
    rpmlib(RichDependencies) = 3:10.3.27 if mariadb) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    (mariadb-connector-c-config = 3.1.11-2.el8_3 if mariadb-connector-c-config) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    rpmlib(RichDependencies) = 1.20 or dhclient) is needed by dracut-network-049-135.git20210121.el8.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by dracut-network-049-135.git20210121.el8.x86_64
    (flatpak-selinux = 1.8.5-3.el8 if selinux-policy-targeted) is needed by flatpak-1.8.5-3.el8.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by flatpak-1.8.5-3.el8.x86_64
    (ipa-selinux if selinux-policy-targeted) is needed by ipa-common-4.9.2-3.module_el8.4.0+780+c53619b9.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by ipa-common-4.9.2-3.module_el8.4.0+780+c53619b9.noarch
    (annobin if gcc) is needed by redhat-rpm-config-125-1.el8.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-125-1.el8.noarch
    To 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'.

    For these "needed by ” is it safe to remove (and possibly reinstall) those to run the distrosync? Or have I screwed something up?

    Reply
    • # dnf remove openssl
      # dnf remove python3
      # dnf remove perl
      

      and try again. Basically, you need to get rid of all dependencies of the packages I posted above.

      Reply
      • How would this work? Removing openssl via dnf would want to remove dnf itself, which would be needed for the next step (even if it would remove the running program).

        Reply
  30. This is now giving me some unresolved packages and not letting me continue. But these steps also had me remove my kernel beforehand – so I appear to now be without a kernel, and unable to upgrade!? RPM commands now fail with some non-descript message about a repo (doesn’t tell me which one) being configured wrong. I think I’ve hosed my system…

    Reply
  31. Thanks! This was really helpful, and also had a very annoying bug.

    You only instruct to install `kernel-core`, while I think probably everyone will also need to install `kernel-modules`. I followed the instructions to upgrade my remote VPS, rebooted and there was no network!! Turns out the drivers are actually in the kernel-modules rpm. Ofc installing anything with a broken NIC driver is very painful. So, I pasting this to hopefully save someone else that pain.

    Thanks!

    Reply
  32. Thanks for the guide.

    Step #4: the mirror URL should be:
    dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-linux-repos-8-2.el8.noarch.rpm,centos-linux-release-8.4-1.2105.el8.noarch.rpm,centos-gpg-keys-8-2.el8.noarch.rpm}

    Reply
  33. Can any guide if have a solution for this issue

    Running scriptlet: libwbclient-4.13.3-3.el8.x86_64 1213/1213
    Running scriptlet: kernel-core-4.18.0-305.7.1.el8_4.x86_64 1213/1213

    Broadcast message from systemd-journald@vl070238-app02-pd-smp-wts-aws-mum-in-vf.vfirst.local (Fri 2021-07-09 19:37:35 IST):

    dracut[27540]: Can’t write to /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64: Directory /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64 does not exist or is not accessible.

    Message from syslogd@vl070238-app02-pd-smp-wts-aws-mum-in-vf at Jul 9 19:37:35 …
    dracut:Can’t write to /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64: Directory /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64 does not exist or is not accessible.
    Can’t write to /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64: Directory /boot/301e98982ddb4aa99dc45bc92cc698d3/4.18.0-305.7.1.el8_4.x86_64 does not exist or is not accessible.
    warning: %posttrans(kernel-core-4.18.0-305.7.1.el8_4.x86_64) scriptlet failed, exit status 1

    Error in POSTTRANS scriptlet in rpm package kernel-core
    Running scriptlet: authselect-libs-1.2.2-2.el8.x86_64 1213/1213
    Running scriptlet: httpd-2.4.37-39.module_el8.4.0+778+c970deab.x86_64 1213/1213
    Running scriptlet: authselect-compat-1.2.2-2.el8.x86_64 1213/1213
    Running scriptlet: tuned-2.15.0-2.el8_4.1.noarch 1213/1213
    Running scriptlet: microcode_ctl-4:20210216-1.20210525.1.el8_4.x86_64 1213/1213
    /usr/lib/dracut/modules.d/40network/module-setup.sh: line 33: warning: command substitution: ignored null byte in input
    /usr/lib/dracut/modules.d/40network/module-setup.sh: line 33: warning: command substitution: ignored null byte in input
    /usr/lib/dracut/modules.d/40network/module-setup.sh: line 33: warning: command substitution: ignored null byte in input
    /usr/lib/dracut/modules.d/40network/module-setup.sh: line 33: warning: command substitution: ignored null byte in input

    Reply
  34. Moderate this comment, if you like: this web page, and a half-dozen like it helped me completely trash my Centos 7 system. Not a VM. A Real Box.

    Over 200 problems during dnf updates. From mundane to ridiculous. openssl, vim (VIM!), irreconcilable differences. Talk about bad advice.

    All to get to centos 8.x so I could run migrate the script to get on rocky Linux. Now I’m doing a bare install of rocky Linux, just like with every release of centos.

    Take this page down. You’re going to get more negative feedback if you don’t.

    Reply
    • Bump. Why are people still trying this? More and more are reporting having a train wreck. Just don’t do it. I’m now running Rocky Linux, but it was not painless. There were differences between CentOS and RL. Just do the clean install. Good luck to you all.

      Reply
  35. I had the same issue with mariadb. I removed mariadb, and now I end up with the following:

    Running transaction check
    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-9.23-1.el8.ppc64le
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-9.23-1.el8.ppc64le
    (annobin if gcc) is needed by redhat-rpm-config-123-1.el8.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-123-1.el8.noarch

    There doesn't seem to be a way to fix this issue as far I can see as it appears to be an issue with the CentOS 8 repositories.

    Reply
    • The follow-up to my own problem.

      Disabling the AppStream repo allowed me to upgrade, so the distro-sync process ran twice. Once with the appstream repo disabled (which did upgrade the system) and then a 2nd time (with appstream enabled) which ‘completed’ the upgrade process. I then ran a dnf upgrade to ensure everything upgraded okay.

      I had a bunch of orphaned el7 packages out there, so I did a quick ‘yum list | grep el7’ to identify them, and I removed those manually to prevent any future compatibility problems.

      Reply
  36. Had to add “–allowerasing” to make mine work?

    # dnf install --allowerasing http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-repos-8-2.el8.noarch.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-linux-release-8.3-1.2011.el8.noarch.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8-2.el8.noarch.rpm
    

    Also, change “upgrade” to “install“.

    # dnf -y upgrade https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    
    Reply
  37. I had the same problem and found a workaround:

    disable AppStream repo

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

    enable AppStream repo

    # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    
    Reply
    • Thanks for the fix here is the command I used to get it to work:

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

      After the installation, I also ran:

      # dnf update -y
      # dnf install kernel
      

      Everything looks good after the reboot now, thanks again.

      Reply
  38. I have upgraded centos 7.9 to centos 8.3.2011,

    but it is still showing old kernel version.

    [root@vl069054 18:12:48 boot]# uname -srv
    Linux 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017
    
    [root@vl069054 18:13:04 boot]# rpm -qa | grep kernel | sort
    kernel-4.18.0-240.10.1.el8_3.x86_64
    kernel-core-4.18.0-240.10.1.el8_3.x86_64
    kernel-headers-4.18.0-240.10.1.el8_3.x86_64
    kernel-modules-4.18.0-240.10.1.el8_3.x86_64
    kernel-tools-4.18.0-240.10.1.el8_3.x86_64
    kernel-tools-libs-4.18.0-240.10.1.el8_3.x86_64
    
    Reply
  39. Alfista – You may see a section like “weak dependencies” that includes some of the packages that require these dependencies. Python3 and Perl stuff has to be removed.

    Reply
  40. Hope to see the same guide for an upgrade from CentOS 7 to Rocky Linux 8 when will be available, this will save a lot of work in migration

    Reply
    • @Luca,

      Sure, once Rocky Linux 8 available, if instructions are there to upgrade from CentOS to Rocky Linux, will surely publish the guide on same..

      Reply
  41. Hi,

    I have a problem with transaction check:

    Running transaction check
    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-9.23-1.el8.x86_64
    rpmlib(RichDependencies) = 3:10.3.27 if mariadb) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    (mariadb-connector-c-config = 3.1.11-2.el8_3 if mariadb-connector-c-config) is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by mariadb-connector-c-3.1.11-2.el8_3.x86_64
    (annobin if gcc) is needed by redhat-rpm-config-123-1.el8.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-123-1.el8.noarch
    To 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'.

    Please can you help me?

    Thanks.

    Reply
  42. Please add a big warning at the top: This may crash your system and cause ants to invade your CPU.

    I followed the instructions on a VM and everything worked. I then did this on one of my servers and lost everything on it. Lots of Googling and hairpulling showed that a number of drivers have been removed from CentOS 8 which means that it just won’t run on older hardware.

    Reply
  43. Please help me…

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

    is giving error

    Problem: The operation would result in removing the following protected packages: kernel

    Reply
  44. This command gives error:

    Next, install CentOS 8 release package using dnf as shown below. This will take a while.

    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.2-2.2004.0.1.el8.noarch.rpm
    
    Reply
  45. At this step I got a fatal error:

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

    Error:

    file /usr/lib/python3.6/site-packages/rpmconf/__pycache__/__init__.cpython-36.opt-1.pyc from install of python3-rpmconf-1.0.21-1.el8.noarch conflicts with file from package python36-rpmconf-1.0.22-1.el7.noarch

    So I just removed all the rpmconf packages:

    # rpm -evh rpmconf-1.0.22-1.el7.noarch
    # rpm -evh python36-rpmconf-1.0.22-1.el7.noarch
    # rpm -evh rpmconf-base-1.0.22-1.el7.noarch
    

    Then the upgrade action was successful, and I continued on. Maybe there is a better web page out there, but being careful in this process and backing up your data is always a good idea. The site did say not to perform on a production server.

    I then ran into errors executing this:

    # dnf -y groupupdate "Core" "Minimal Install"
    

    but when I excluded yum it at least completed:

    # dnf -y groupupdate "Core" "Minimal Install" --exclude=yum
    

    At that stage I assumed given the kernel installed well, it needs a reboot to test whether it would be successful.

    The system came back-up and I installed a program to test dnf is working. Seems like it is.

    Reply
  46. Thank you for this post. I got an error:

    sudo dnf -y –releasever=8 –allowerasing –setopt=deltarpm=false distro-sync
    [sudo] password for yjiang:
    CentOS-8 – Base 545 kB/s | 2.2 MB 00:04
    Remi’s PHP 7.2 RPM repository for Enterprise Linux 7 – x86_64 170 kB/s | 221 kB 00:01
    MySQL 8.0 Community Server 4.1 MB/s | 1.5 MB 00:00
    IUS for Enterprise Linux 7 – x86_64 1.7 MB/s | 624 kB 00:00
    MySQL Connectors Community 193 kB/s | 94 kB 00:00
    Safe Remi’s RPM repository for Enterprise Linux 7 – x86_64 615 kB/s | 2.3 MB 00:03
    CentOS-7 – SCLo sclo 496 kB/s | 1.1 MB 00:02
    geekery repository 0.0 B/s | 0 B 00:00
    CentOS-7 – SCLo rh 1.2 MB/s | 14 MB 00:11
    Extra Packages for Enterprise Linux 7 – x86_64 8.1 MB/s | 16 MB 00:02
    CentOS-8 – AppStream 1.8 MB/s | 5.8 MB 00:03
    MySQL Tools Community 505 kB/s | 553 kB 00:01
    CentOS-8 – Extras 43 kB/s | 8.1 kB 00:00
    Failed to synchronize cache for repo ‘geekery’, ignoring this repo.
    Error:
    Problem: The operation would result in removing the following protected packages: kernel

    Reply
  47. My Baremetal running centos7 started giving segmentation faulty post this. Lost all the data on the host. Please follow the procedure at your own risk.

    Reply
  48. Hi Team,

    # sudo dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync --best
    Last metadata expiration check: 0:05:30 ago on Tue 13 Oct 2020 12:23:13 PM IST.
    Error:
     Problem: The operation would result in removing the following protected packages: dnf
    

    I did below, still no luck. There is no value under /etc/yum/protected.d/.

    # rm /etc/dnf/protected.d/dnf.conf
    

    Please help

    Reply
  49. Hi,

    I tried to follow this guide to upgrade from centos7 to 8, I didn’t manage with the upgrade but most of the packages are in el8, I am also having problems installing packages with the below error:

    Total                                           1.4 MB/s |  35 MB     00:25     
    Running transaction check
    Error: transaction check vs depsolve:
    (flatpak-selinux = 1.6.2-3.el8_2 if selinux-policy-targeted) is needed by flatpak-1.6.2-3.el8_2.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by flatpak-1.6.2-3.el8_2.x86_64
    To 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 the cache until the next successful transaction.
    You can remove cached packages by executing 'dnf clean packages'.
    

    Kindly assist.
    Regards

    Reply
    • Do this:

      1. Try to repair database as suggested:

      # rpm --rebuilddb
      

      2. If it still does not work, reinstall flatpak packages:

      # dnf reinstall flatpak*
      

      3. If it still does not work, remove flatpak packages and install them again:

      # dnf remove flatpak*
      

      4. If dnf does not work, use rpm:

      # rpm -e flatpak flatpak-selinux
      

      5. If there are dependecies, remove with them:

      # rpm -e flatpak flatpak-selinux [anotherpackages]
      

      6. If you are sure what you are doing, use:

      # rpm -e --nodeps 
      
      Reply
  50. The latest packages for core:

    # dnf upgrade -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{centos-release-8.2-2.2004.0.1.el8.x86_64.rpm,centos-gpg-keys-8.2-2.2004.0.1.el8.noarch.rpm,centos-repos-8.2-2.2004.0.1.el8.x86_64.rpm}

    Reply
  51. When trying to group update about “Core” “Minimal Install“, centos system has error in yum.

    Can I get the solution?

    Environment
    – CentOS 7.5

    ** Error Messages

    # dnf groupupdate "Core" "Minimal Install"
    ...
    Running transaction check
    Transaction check succeeded.
    Running transaction test
    Transaction test succeeded.
    Running transaction
      Preparing        :     
      Installing       : yum-4.2.17-7.el8_2.noarch     
    Error unpacking rpm package yum-4.2.17-7.el8_2.noarch
      Verifying        : yum-4.2.17-7.el8_2.noarch  
    
    Failed:
      yum-4.2.17-7.el8_2.noarch
    
    Error: Transaction failed
    
    Reply
  52. # dnf -y --releasever=8 --setopt=deltarpm=false --allowerasing --best distro-sync
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    CentOS-8 - Updates Sources          
    CentOS-8 - cr                        
    CentOS-8 - Base Sources              
    CentOS-8 - Base   
    Failed to synchronize cache for repo 'updates-source', ignoring this repo.
    Failed to synchronize cache for repo 'cr', ignoring this repo.
    Failed to synchronize cache for repo 'base-source', ignoring this repo.
    Failed to synchronize cache for repo 'base', ignoring this repo.
    Failed to synchronize cache for repo 'updates', ignoring this repo.
    Last metadata expiration check: 0:09:25 ago on Sun 16 Aug 2020 10:30:35 AM CDT.
    Error: 
     Problem: The operation would result in removing the following protected packages: dnf
    
    Reply
      • I am also getting the same error, I have no repo issues, I tried removing dnf from /etc/dnf/protected.d/ and /etc/yum/protected.d/. But no luck

        # dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
        Last metadata expiration check: 0:04:49 ago on Tue 13 Oct 2020 12:45:13 PM IST.
        Error:
         Problem: The operation would result in removing the following protected packages: dnf
        
        Reply
  53. These docs should be removed as they DO NOT and WILL NOT work. Even on a clean Centos 7 system, this process will fail because of dependencies.

    This procedure will break your system. It will at best, leave you spinning on the dependency check that will never complete (8+ hours and it didn’t complete), or leave you with a difficult to resolve circular dependency with python or GCC.

    There are ways to unbrick a system by manually downloading and manually extracting packages to jumpstart a DNF reinstallation of broken packages, but it’s not worth it.

    Reply
  54. Hi James,

    Thank you for the thoughtful article.

    After following this closely, I was was able to upgrade with no issue — just an old python 3.6 repo that I removed, based on the conflict report.

    Very much enjoying the new Web Cockpit.

    Thanks again!

    Trevor

    Reply
  55. I’ve got the following error on distro-sync step:

    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-8.90-1.el8.0.1.x86_64
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-8.90-1.el8.0.1.x86_64
    (annobin if gcc) is needed by redhat-rpm-config-122-1.el8.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-122-1.el8.noarch
    To 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'.
    

    Case anyone has ideas about how to fix it

    Reply
    • I’ve had the same problem and resolved it with:

      # dnf remove perl
      # dnf remove python3
      

      then

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

      and reinstall perl (if necessary)

      Reply
    • Dude, these “howtos” arrive every time there is a major version update and they NEVER work for real installations.

      1) No Centos system I have ever run will let you remove any kernel, because, “IT IS THE KERNEL” and it refuses to do so using yum, or dnf.

      2) Even when you skip all of that, and just jump to the upgrade of installed packages, you end up needing to actually remove everything on the system, and then basically start from a vanilla install, and that probably still won’t work.

      I ALWAYS end up just fully reinstalling using media, after backing up or migrating the necessary bits from the current install.

      These tutorials are always worthless in the real world.

      I believe these guys are working with a fedora or bleeding-edge centos development branch with certain features turned off, which are never disclosed.

      Reply
      • Also, one of the “updated” comments from a reader back in the spring indicated that they had some issues with python36-* and just “removed it” to continue. Well, I just figured I would remove the python packages that were also proving to be troublesome since this was just a development hypervisor for my openshift cluster and some other stuff. (I.E. all the important stuff is on the hardware raid built into the chassis, and I use installation ssds to run the actual OS.)

        So I just wanted to see how far I would get, and maybe for possibly the third major release in a row won’t force full vanilla install at some point.

        Welp, sure enough, once I started removing python3 stuff that it was complaining about, dnf (python app) started giving errors about not being able to find named module, etc….

        However, if you remember from earlier steps, you have already fully removed “yum” in place of “dnf.”

        However, I have also come across this exact situation when migrating from CentOS 6 to CentOS 7 before they came up with the nifty “in place update” tooling that made it so easy and less problematic.

        So yup, these articles are always a trip, because they never really work.

        I have to assume that just like the Linux “gurus” of old, where the world “worked on their box” but when you tried to find out how to build the world on yours, you were always left floating in space as they confidently indicated that “it works on their box….”

        I think these articles are based on a minimum-proof-of-concept that no one is actually running. (Like making some minimalist install that would require so much removal of items and packages to get back to, that you may as well just install fully with new media.)

        Reply
      • “1) No Centos system I have ever run will let you remove any kernel, because, “IT IS THE KERNEL” and it refuses to do so using yum, or dnf.”

        Well, use rpm and put --nodeps and you can remove the kernel. But yes, if something goes wrong, you will end up bricking the system, there will be no kernel to boot into. I was able to upgrade to 8.2, had to rpm -e --nodeps the kernel; also had to remove devel packages – what I did was list the devel packages that were being removed into a file and reinstall all of them after the base upgrade was finished; had to do this for about 25 packages. Also, the upgrade usually works only at minimal install level, had to then group install development tools, systems tools, security tools, etc etc. A real pain, but possible.

        Reply
        • Thanks for the update, but I have been holding off getting back onto that test hypervisor because I have to basically re-install python because now dnf doesn’t know how to run using python 2 or whatever is currently installed.

          There is always some “bricking” command included in these tutorials. I was just wondering if that were still the case, and sure enough, once I got over the hurdles referenced by the other guys, I ended up with a system that can’t install anything else, because I have uninstalled python3 and yum is gone so nothing cares about python2 or whatever is currently installed. LOL…

          Reply
  56. Other correction on step4:

    # rpm -e `rpm -q kernel`
    

    if you will received an error like:

    kernel(wait_for_completion) = 0x6d0aba34 is needed by (installed) kmod-kvdo-6.1.3.7-5.el7.x86_64
    kernel(wait_for_completion_interruptible) = 0x015ddbdc is needed by (installed) kmod-kvdo-6.1.3.7-5.el7.x86_64
    kernel(wake_up_process) = 0xe65cdceb is needed by (installed) kmod-kvdo-6.1.3.7-5.el7.x86_64
    kernel(yield) = 0x760a0f4f is needed by (installed) kmod-kvdo-6.1.3.7-5.el7.x86_64

    you need to remove this packages in order to proceed further:

    # rpm -e kmod-kvdo vdo
    
    Reply
  57. This upgrade works with some little corrections:

    Step 4
    =====

    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm
    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm
    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    

    should be executed as one command line and with the updated links to avoid errors.

    For example:

    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.2-2.2004.0.1.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.2-2.2004.0.1.el8.noarch.rpm

    Reply
  58. Ugh! I wish I had read these comments before I followed these instructions and destroyed my Centos 7 installation. What exactly is the point of posting these instructions?

    Reply
    • @John,

      We clearly stated that: The steps described herein do not depict the official upgrade and this should not be applied to a production server yet.

      Reply
    • @VP,

      We clearly stated in the beginning “The steps described herein do not depict the official upgrade and this should not be applied to a production server yet.”

      Reply
      • Thank you for responding @Ravi.

        I want to mention that I always get wonderful articles and steps in TecMint site for a lot of tasks and it’s very useful for me and for all who are looking for the same.

        Regarding this article, obviously I did not perform the steps on the production server. I had read your instructions on the top. And I think no one would directly implement such sort of work directly on the production server. It did not work for the test environment either.

        Many have given some corrections and other helpful links in the comment. I followed them also but still, the test didn’t complete successfully.

        Maybe it had worked earlier but I think no longer now.

        But thanks for giving me a good option to try.

        Regards.

        Reply
    • Is working.

      The only problem I got conflict with some python packages in time of upgrade after the command:

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

      Simple remove conflict package:

      # dnf remove python36-rpmconf-1.0.22-1.el7.noarch
      

      and repeat:

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

      Next thing was network interfaces renamed and badly configured ( old “eth” -> new “ens”) – in this case, “nmtui” is Your friend

      Thanks Ravi for your great tutorial

      Reply
  59. I upgraded my CentOS kernel 7 to 8, but some packages didn’t.

    I tried:

    # dnf install mod_http2
    

    and I get an error:

    Error: Transaction check error:
    file /usr/share/pixmaps/poweredby.png from install of centos-logos-httpd-80.5-2.el8.noarch conflicts with file from package centos-logos-70.0.6-3.el7.centos.noarch

    Then I wanted to remove the old package:

    # rpm -e centos-logos-70.0.6-3.el7.centos.noarch
    

    Guess what:

    error: Failed dependencies:
    system-logos >= 7.92.1-1 is needed by (installed) httpd-2.4.6-90.el7.centos.x86_64
    system-logos is needed by (installed) plymouth-0.8.9-0.32.20140113.el7.centos.x86_64

    When I wanted to know about those packages:

    # rpm -qi httpd
    ...
    Release     : 90.el7.centos
    

    and

    # rpm -qi plymouth
    ...
    Release     : 0.32.20140113.el7.centos
    

    I am stuck!

    I would appreciate any help.

    Reply
    • You have to finish last dnf transaction, try to upgrade the system (--nobest, --skip-broken, etc) or remove all duplicates at once (dnf repoquery --duplicates).

      Reply
  60. I’m also stuck on Step #4 but a little further down at “Thereafter, launch the CentOS 8 system upgrade as shown”:

    [root@life01 ~]# dnf -y –releasever=8 –allowerasing –setopt=deltarpm=false distro-sync
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    CentOS-8 – Base 0.0 B/s | 0 B 00:00
    CentOS-8 – Updates 0.0 B/s | 0 B 00:00
    CentOS-8 – Extras 0.0 B/s | 0 B 00:00
    Failed to synchronize cache for repo ‘base’, ignoring this repo.
    Failed to synchronize cache for repo ‘updates’, ignoring this repo.
    Failed to synchronize cache for repo ‘extras’, ignoring this repo.
    Last metadata expiration check: 0:02:16 ago on Tue 21 Apr 2020 06:56:57 AM UTC.
    Error:
    Problem: The operation would result in removing the following protected packages: dnf, systemd

    Obviously, I don’t want to get rid of dnf or systemd. I’m digging around but thought I’d check if anyone has run into this. There’s also the “Failed to synchronize cache for repo” warning but I’ll look into that later.

    Reply
    • The given command is not complete. You need to add the minor version too (8.1)

      # dnf -y --releasever=8.1 --allowerasing --setopt=deltarpm=false distro-sync
      
      Reply
  61. I managed to upgrade two of my servers, but was unable to update the majority of my servers and simply had to reinstall (rebuild them). This is the main command that I used for the servers I managed to upgrade using the above process.

    dnf upgrade -y http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/{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.

    I also found MonkeyPet’s contribution to dependency hell very useful.

    Here is a reminder

    # dnf install gdbm gdbm-libs --best --allowerasing
    

    Now for the real stinger.

    Even after navigating the following problem dependency problem with the aid of MonkeyPet’s suggestion

    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-8.78-1.el8.x86_64
    

    my servers upgraded but crashed on boot up because their local storage controllers could not be recognized (you just get an infinite hang on boot uploading the newly upgraded kernels). The reason why is because a large number of storage controller drivers were removed from the RHEL8.x and hence Centos 8.x base kernel during RHEL 8.x development.

    This affects a number of common workhorses Entry and Medium Level servers some of which were on sale 3 years ago (e.g. Dell R210, R510, R710). See the list of deprecated drivers here;

    https://elrepo.org/linux/dud/el8/x86_64

    The drivers can only be installed as part of the Driver Update Disk (DUD) process during a reinstall, so this rules out upgrading from Centos7 to Centos8 for a fair number of servers. Take heed.

    Reply
  62. I have a segmentation fault ins response to “dnf -y remove yum yum-metadata-parser .

    What could be the solution?

    Reply
  63. Hi,

    I’m really at a loss about a weird problem after “rebooting”. I find that my network config is messed up. The 1st NIC eth0 is now renamed en1sp0, and the network config is not respecting the ifcfg-enp1s0 file.

    [root@se63 ~]# ifconfig
    enp1s0: flags=4163  mtu 1500
            inet 192.168.1.63  netmask 255.255.255.255  broadcast 192.168.1.63
            inet6 fe80::1e1b:dff:fe73:465d  prefixlen 64  scopeid 0x20
    

    Whereas, the ifcfg-enp1s0 says:

    TYPE=Ethernet
    BOOTPROTO=none
    DEFROUTE=yes
    IPV4_FAILURE_FATAL=yes
    IPV6INIT=yes
    IPV6_AUTOCONF=no
    IPV6_DEFROUTE=no
    IPV6_FAILURE_FATAL=no
    NAME=enp1s0
    DEVICE=enp1s0
    ONBOOT=yes
    IPADDR=192.168.1.63
    #SUBNET=255.255.255.0
    PREFIX=24
    GATEWAY=192.168.1.64
    DNS1=8.8.8.8
    DNS2=8.8.4.4
    IPV6_PEERDNS=yes
    IPV6_PEERROUTES=yes
    

    I just couldn’t get it to respect these settings at all! I read many articles, which said that NetworkManager now controls these settings, but everything says it respects the ifcfg files in /etc/sysconfig/network-scripts.

    So, can anyone help how the /32 address is coming up?

    Reply
  64. Hi,

    My Centos 7 install fails at the “dnf install” lines under Step 4:

    [root@se63 ~]# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm
    Last metadata expiration check: 0:01:17 ago on Mon 30 Mar 2020 01:11:24 AM +06.
    centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm 17 kB/s | 12 kB 00:00
    Error:
    Problem: conflicting requests
    - nothing provides centos-gpg-keys = 8.1-1.1911.0.8.el8 needed by centos-repos-8.1-1.1911.0.8.el8.x86_64
    - nothing provides system-release = 8.1 needed by centos-repos-8.1-1.1911.0.8.el8.x86_64
    [root@se63 ~]# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm
    Last metadata expiration check: 0:01:37 ago on Mon 30 Mar 2020 01:11:24 AM +06.
    centos-release-8.1-1.1911.0.8.el8.x86_64.rpm 25 kB/s | 21 kB 00:00
    Error:
    Problem: conflicting requests
    - 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
    [root@se63 ~]# dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    Last metadata expiration check: 0:01:47 ago on Mon 30 Mar 2020 01:11:24 AM +06.
    centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm 41 kB/s | 11 kB 00:00
    Error:
    Problem: problem with installed package centos-release-7-7.1908.0.el7.centos.x86_64
    - package centos-gpg-keys-8.1-1.1911.0.8.el8.noarch conflicts with centos-release < 8.0-0.1905.0.10 provided by centos-release-7-7.1908.0.el7.centos.x86_64
    - conflicting requests
    (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)

    The previous command ran perfectly:
    [root@se63 ~]# dnf upgrade
    Extra Packages for Enterprise Linux 7 - x86_64 5.9 MB/s | 16 MB 00:02
    Docker main Repository 32 kB/s | 28 kB 00:00
    CentOS-7 - Base 5.1 MB/s | 10 MB 00:02
    CentOS-7 - Updates 4.6 MB/s | 9.4 MB 00:02
    CentOS-7 - Extras 80 kB/s | 259 kB 00:03
    Dependencies resolved.
    Nothing to do.
    Complete!

    What could be going wrong?

    Reply
    • Solved it! The comment from “bartmantv” was really helpful!

      I stumbled upon another error that was solved by the “MonkeyPet” solution!

      Thank you, everyone!

      Reply
  65. I’m trying to upgrade centos, but I’m having problems after

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

    Error: transaction check vs depsolve:
    (gcc >= 8 with gcc < 9) is needed by annobin-8.78-1.el8.x86_64
    rpmlib(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.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-120-1.el8.noarch
    To diagnose the problem, try running: 'rpm -Va –nofiles –nodigest'.

    I tried:

    # dnf remove redhat-rpm-config
    

    and also removed the package with issues in:

    #  rpm -Va --nofiles --nodigest
    

    and after that I did.

    # rpm --rebuilddb
    

    But, the same problem.

    Tried:

    # dnf clean packages
    

    Tried 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.noarch
    

    but still the same problem.

    Any help with what is the problem?

    Reply
  66. It’s pretty good, with minor flaws though:

    Firstly, I ran into difficulty remove kernel rpm because I’m using vdo support. You have to remove that.

    Then too, you must install all 3 centos-release/repos/keys rpm in one command since they are dependency loop, old school headache.

    There are lots of transactions fail during ‘dnf upgrade‘ but basically because I’m using some 3rd party repos and I can fix that later.

    Thanks anyway, it’s a good one.

    Reply
  67. Okay, it magically came back after I couldn’t even ssh, was dumping a random error. Came back to shell and I was able to fix the rest

    still sketchy..! backup first / no production!

    Reply
  68. Even if the process might work, it is not a tested procedure by Red Hat. Why not use Leapp, which is what Red Hat supports?

    Reply
  69. I just did this myself had to modify the rpm installation step, this needs to be a single install command including all the files

    So instead of this step:

    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm
    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm
    # dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    

    anonymous previously on Feb 7 stated this, so your update was close, it has to be one line for dependencies to work. I’ve escaped the newline so it can formatted for webpage use…

    # dnf install http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm \
    http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm \
    http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    
    Reply
  70. dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

    It doesn’t seem to upgrade the el7 RPMs to the el8 versions. Now that 8.1 is out, is the repos setup for that upgrade is conflicting with the upgrade process?

    I tried
    dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false upgrade

    But that didn’t work either. Now the system will download a whole bunch of RPMs and not install them.

    Wonder if I go to the repo files and hard code the path to the 8.0 repo if it would at least get me to that release then the 8.1 can take over from there.

    Reply
  71. To fix the “rpmlib(RichDependencies) <= 4.12.0-1&quot; problem you need newer rpm on CentOS 7.

    Upgrade the packages "rpm", "rpm-libs", "rpm-plugin-selinux", "python2-rpm" from: https://cbs.centos.org/kojifiles/packages/rpm/4.13.0.2/1.el7.c8/x86_64/

    Reply
  72. change the step

    # 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

    as per:

    # dnf install http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.8.el8.x86_64.rpm
    # http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm
    # http://less.cogeco.net/CentOS/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm

    Reply
  73. Thanks, but it doesn’t work, at the moment the new release is centos-release-8.1-1.1911.0.8.el8.x86_64.rpm. The upgrade just stop

    [root@localhost ~]# cat /etc/centos-release
    CentOS Linux release 7.7.1908 (Core)
    

    [root@localhost ~]# dnf -y upgrade http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.8.el8.x86_64.rpm
    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!
    [root@localhost ~]#
    [root@localhost ~]#

    [root@localhost ~]# rpm -ivh http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    Retrieving http://mirror.bytemark.co.uk/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.8.el8.noarch.rpm
    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
    [root@localhost ~]#

    Reply
    • Try to do things in the following order:

      dnf -y upgrade http://mirror.bytemark.co.uk/centos/8.0.1905/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm
      dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1 -1.1911.0.8.el8.noarch.rpm

      This should be enough to install and upgrade all the necessary packages

      Reply
    • You need to issue the command in one single line:

      dnf install http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-repos-8.1-1.1911.0.9.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-release-8.1-1.1911.0.9.el8.x86_64.rpm http://mirror.centos.org/centos/8/BaseOS/x86_64/os/Packages/centos-gpg-keys-8.1-1.1911.0.9.el8.noarch.rpm

      Reply
  74. Need to use dnf -y upgrade http://mirror.bytemark.co.uk/centos/8.0.1905/BaseOS/x86_64/os/Packages/centos-release-8.0-0.1905.0.9.el8.x86_64.rpm as 8.1 is out.

    Reply
  75. Please help:

    dnf upgrade shows this error:

    Error: Transaction check error:
    file /usr/lib64/libgdbm_compat.so.4.0.0 from install of gdbm-libs-1:1.18-1.el8.x86_64 conflicts with file from package gdbm-1.10-8.el7.x86_64

    Thanks! ASAP.

    Reply
  76. So I completed your guide to upgrading CentOS 7 to 8 after fixing the issue I mentioned earlier. But after I rebooted, I only see the CentOS 7 boot loader and none of the boot loaders can boot because CentOS 7 is gone. I can still boot into rescue mode – is there a way to edit the boot screen to pick up the new CentOS 8 boot loader?

    Reply
  77. Total mess – Do not do it

    I just stuck in it. nor you can update with DNF or any way to reinstall yum again.!!!

    can not run any program like this:
    /usr/sbin/squid: symbol lookup error: /usr/sbin/squid: undefined symbol: _ZN7libecap4NameC1ERKNSt7__cxx1112basi...IcESaIcEE

    Last metadata expiration check: 0:11:25 ago on Thu 26 Dec 2019 07:49:40 PM +0330.
    Error:
    Problem: package python3-dnf-4.0.9.2-5.el8.noarch requires dnf-data = 4.0.9.2-5.el8, but none of the providers can be installed
    – package dnf-4.0.9.2-5.el8.noarch requires python3-dnf = 4.0.9.2-5.el8, but none of the providers can be installed
    – cannot install both dnf-data-4.0.9.2-5.el8.noarch and dnf-data-4.0.9.2-1.el7_6.noarch
    – package yum-4.0.9.2-5.el8.noarch requires dnf = 4.0.9.2-5.el8, but none of the providers can be installed
    – package python2-dnf-4.0.9.2-1.el7_6.noarch requires dnf-data = 4.0.9.2-1.el7_6, but none of the providers can be installed
    – conflicting requests
    – problem with installed package python2-dnf-4.0.9.2-1.el7_6.noarch
    (try to add ‘–allowerasing’ to command line to replace conflicting packages or ‘–skip-broken’ to skip uninstallable packages)

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

    Running transaction check
    Error: transaction check vs depsolve:
    (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    To 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'.

    Reply
    • I’m glad the guide worked. We are trying to get to the bottom of the matter on other cases where the installation didn’t go quite well as expected.

      Reply
  79. This tutorial doesn’t work. Upgrading from the latest 7 series (7.7.1908) ends up with the aforementioned error by other people.

    Error: transaction check vs depsolve:
    (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    To 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'.

    I'm an experienced sysadmin, btw… This shouldn't be Google's the first result frankly…

    Reply
    • Solution: dnf -y --exclude=annobin --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

      Next problem: conflicting packages. Solution: Removing all packages with conflicts (many in my install!)

      Reply
      • This got me through.. I also had to exclude lib webp.

        We will have to manually fix those conflicts after but yeah… I think I finally got through

        messy

        Reply
  80. I’ve tried the steps twice now (clean install) and when I get to this stage I always get the following error. (Steps to duplicate at the end, I have to load Virtualmin on Centos 7 as it does not yet support RH Enterprise or Centos 8)

    At this stage of the process…

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

    Running transaction check
    Error: transaction check vs depsolve:
    (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    To 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'.

    (none of the " suggested fixes" work)

    Steps to reproduce.

    Centos7 – load minimal server.
    Centos7 – load minimal desktop (loading sequence at end)
    Centos7 – Grab Virtualmin install script and run the install
    login to virtualmin (https://localhost:10000) and finish installation.

    Now follow the above steps in this tutorial to upgrade.

    Here's how I installed the desktop.

    # yum groupinstall “X Window System”
    # yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts firefox
    # unlink /etc/systemd/system/default. target.
    # ln -sf /lib/systemd/system/graphical. target /etc/systemd/system/default. target.
    # reboot
    
    Reply
  81. Hello,

    I am running into an error when running the actual upgrade command.

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


    Running transaction check
    Error: transaction check vs depsolve:
    (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    rpmlib(RichDependencies) = 2.87-5 is needed by (installed) initscripts-9.49.47-1.el7.x86_64
    Unsatisfied dependencies for iprutils-2.4.17.1-2.el7.x86_64:
    /sbin/pidof is needed by (installed) iprutils-2.4.17.1-2.el7.x86_64

    The “rpm –rebuilddb” command was not helpful.

    Any idea what to do next?

    Thanks,
    Joseph

    Reply
    • Actually, this is the series of commands and responses (what was pasted into my first note missed a few details):


      Running transaction check
      Error: transaction check vs depsolve:
      (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
      rpmlib(RichDependencies) = 2.87-5 is needed by (installed) initscripts-9.49.47-1.el7.x86_64
      Unsatisfied dependencies for iprutils-2.4.17.1-2.el7.x86_64:
      /sbin/pidof is needed by (installed) iprutils-2.4.17.1-2.el7.x86_64

      Reply
      • It might be a good choice to remove all packages with `el7` in its name and reinstall it again with epel8. It seems working on my server.

        Reply
    • I had the same error with “(annobin if gcc)” and “rpmlib(RichDependencies)“. No amount of uninstalling packages/rpms etc would clear it.

      I ended up giving up and restoring my filesystems back to just before I started the update.

      (yes, my first step was to take a backup of my filesystems . . . . )

      Reply
        • @Adrian,

          I have tested the same upgrade instructions on my CentOS 7.7, it did work for me without any error and I managed to upgrade it to CentOS 8.

          We are testing again with other CentOS 7.x versions, we will keep you posted…

          Reply
    • @Zaur,

      Use dnf command, instead yum, as dnf is the default package manager of RHEL 8. If you still want to use yum command, just install it:

      # dnf install yum
      
      Reply
  82. Ran into an issue…

    When I rebooted after doing this upgrade the system didn’t come up properly and I couldn’t log in at the console as the password was not being authenticated. This turned out to be because CentOS 7 hadn’t been using SELinux and CentOS 8 was by default but the filesystem hadn’t been labeled.

    The easy fix was to “touch /.autorelabel” and reboot (thank ${DEITY} for dracut emergency shell!). Probably worth adding that touch command to your instructions just to be safe.

    Reply
  83. Thanks for the nice article. One question: How should I expand the instructions considering that in my Centos 7 install I have the following repositories active?

    repo id repo name
    Webmin Webmin Distribution Neutral
    base/7/x86_64 CentOS-7 – Base
    epel/x86_64 Extra Packages for Enterprise Linux 7 – x86_64
    extras/7/x86_64 CentOS-7 – Extras
    updates/7/x86_64 CentOS-7 – Updates

    Thanks in advance

    Reply
      • Thant’s not right. I was able to proceed with the upgrade while having REMI Repo active after I upgraded REMI rpm to EL8. Otherwise upgrading EPEL repo is not possible. I think, there might be more issues with other repos.

        Reply
  84. I got the following error message when I run the command below.
    [root@step01 ~]# rpm -e `rpm -q kernel`
    error: Failed dependencies:
    kernel(PDE_DATA) = 0x44f0d59d is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(___ratelimit) = 0x155f4108 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__bitmap_weight) = 0x4cbbd171 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__cond_resched_lock) = 0xe2cfb038 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__init_waitqueue_head) = 0xf432dd3d is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__list_add) = 0x0343a1a8 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__list_del_entry) = 0x65e75cb6 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(__mutex_init) = 0x9a025cd5 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64

    Reply
  85. Hi James,

    Thanks for this awesome write-up. It’s refreshing to see this even though https://centos.org/forums/viewtopic.php?t=71848 mentioned such a script is not possible. I’m hitting a bit of a problem with the step where I’m supposed to “launch the CentOS 8 system upgrade as shown.” executing:

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

    After executing that line, I’m met with the following output:

    “`
    Last metadata expiration check: 0:24:37 ago on Mon 18 Nov 2019 11:56:09 AM CST.
    Error:
    Problem: The operation would result in removing the following protected packages: kernel
    “`

    Reply
    • I eventually got past this as I realized when I was executing “rpm -e `rpm -q kernel`” I actually had some errors so that didn’t pass. Getting past these errors got me past my problems.

      Reply
  86. $ sudo dnf --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    

    Last metadata expiration check: 0:03:51 ago on Mon 18 Nov 2019 11:56:09 AM CST.
    Error:
    Problem: The operation would result in removing the following protected packages: kernel

    Reply
  87. I get to this stage of the process “# dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync“, and nothing happens. Doing this it immediately gives system prompt, no message.

    Followed every step very precisely. The one that caused grief was “rpm -e `rpm -q kernel`” – reported programs that needed the kernel, but I was expecting to clean up “old kernels” later, so did not worry too much about it. See typical messages at the end of a note.

    Also. When I ran the “rpmconf -a” command, I never saw the “2nd question”. After answering "n" to the first, I jumped straight to the system prompt.

    This was my 2nd attempt.

    Fresh install loaded Centos 7 >> Server with GUI – minimal install.

    Loaded Webmin / Virtualmin for LAMP system (does not yet support Centos 8, hence the Centos 7 route).

    Then run through all steps in the guide, until…

    Regards – Nigel Aves

    rpm -e `rpm -q kernel`
    error: Failed dependencies:
    kernel >= 3.10.0-384.el7 is needed by (installed) hypervvssd-0-0.34.20180415git.el7.x86_64
    kernel >= 3.10.0-384.el7 is needed by (installed) hypervfcopyd-0-0.34.20180415git.el7.x86_64
    kernel >= 3.10.0-384.el7 is needed by (installed) hypervkvpd-0-0.34.20180415git.el7.x86_64
    kernel >= 3.10.0-1025.el7 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel >= 2.6.32 is needed by (installed) lldpad-1.0.1-5.git036e314.el7.x86_64
    kernel(PDE_DATA) = 0x44f0d59d is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64
    kernel(___ratelimit) = 0x155f4108 is needed by (installed) kmod-kvdo-6.1.2.41-5.el7.x86_64

    and on and on and on !! …… pages and pages of this type of error.

    Reply
  88. Even “dnf update” works, there is an error:

    dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync
    CentOS-8 – Base 0.0 B/s | 0 B 00:00
    CentOS-8 – Updates 0.0 B/s | 0 B 00:00
    Failed to synchronize cache for repo ‘base’, ignoring this repo.
    Failed to synchronize cache for repo ‘updates’, ignoring this repo.
    Last metadata expiration check: 0:07:33 ago on Sat Nov 16 09:53:12 2019.
    Error:
    Problem: The operation would result in removing the following protected packages: dnf

    Reply
    • I had the same problem. Got it working with:

      1. Updating kernel on its own:

      # dnf update kernel
      

      2. Uninstalling the kernel (didn’t work before, the kernel is needed by)

      # rpm -e `rpm -q kernel`
      

      After that ‘dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync‘ worked.

      Reply
  89. Excellent tutorial, just a few remarks:

    – For me, it was necessary to remove some packages which are not available on the new release, in this example in particular “bash-completion-extras” which just doesn’t exist in the release 8 and prevented the DNF upgrade to be able to work.

    – It should also be stated that before you finally apply the upgrade to the new release you should check carefully which packages will be removed without replacement because again, some don’t exist in the new release and therefore will just be gone.

    In my example, the “transmission” packages were gone because they are neither offered by the base repos nor epel.

    – Also interesting to know, if some SELinux settings had been altered prior to the system upgrade, these will be gone and need to be set again after the upgrade.

    For example allowing the sshd daemon to listen on a different port:

    # semanage port -a -t ssh_port_t -p tcp 2222
    
    Reply
  90. This part:
    rpm -e `rpm -q kernel`
    fails. I get hundreds of dependency errors and nothing gets erased. And then the next step fails with the message:
    Problem: The operation would result in removing the following protected packages: kernel

    Reply
  91. Other than 2 minor non-stopping errors (dnf -y install kernel-core told me it was already updated and dnf groupupdate of core told me it couldn’t find the package yum) the upgrade went fine.

    Great guide!

    Reply
  92. Hi: I need help for this error

    Running transaction check
    Error: transaction check vs depsolve:
    (annobin if gcc) is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-116-1.el8.0.1.noarch
    To 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'.

    Reply
    • @Linux,

      Have you followed all the instructions correctly? what command does give the error message? I request you to follow the instructions again carefully….

      Reply
    • Encountered the _same_ error.

      I advise you to run “rpm -Va --nofiles --nodigest” and see what it shows, then remove as said in the article all conflict RPMs with dnf (“dnf remove pkg_name“). In the end “rpm --rebuilddb” for sure.

      Then run “dnf check” – look at problems and remove another portion of packages mentioned from the report (same “dnf remove package_name“).

      I’ve removed: dnf remove redhat-rpm-config.noarch && dnf remove microcode_ctl && dnf remove initscripts && dnf remove rpm-build
      this is not the full list, and maybe there are some differs in pkg names.

      Take them all from the outputs above.

      Reply
    • @Aman,

      That really good to know, we have tested the Centos 7 to 8 upgrade process in 2-3 servers to make sure that the upgrade process is error-free.

      Reply

Got something to say? Join the discussion.

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.