How to convert RHEL 6.x to CentOS 6.x

Last modified: [last-modified]

This post relates to my older post about converting RHEL 5.x to CentOS 5.x. All the reasons for doing so and other background information can be found in that post.

This post will cover how to convert RHEL 6.x to 5.x.

Updated 2016-03-29 – Thanks to feedback from here I’ve updated the guide.

Updates and Backups!

  1. Fully patch your system and reboot your system before starting this process
  2. Take a full backup of your system or a Snapshot if it’s a VM


  1. Login to the server and become root
  2. Clean up yum’s cache
    localhost:~ root# yum clean all
  3. Create a temporary working area
    localhost:~ root# mkdir -p /temp/centos
    localhost:~ root# cd /temp/centos
  4. Determine your version of RHEL
    localhost:~ root# cat /etc/redhat-release
  5. Determine your architecture (32-bit = i386, 64-bit = x86_64)
    localhost:~ root# uname -i
  6. Download the applicable files for your release and architecture. The version numbers on these packages could change. To find the current versions of these files browse this FTP site: (32-bit) or (64-bit) and replace the ‘x’ values below with the current version numbers
    CentOS 6.5 / 32-bit

    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget

    CentOS 6.5 / 64-bit

    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget
    localhost:~ root# wget
  7. Import the GPG key for the appropriate version of CentOS
    localhost:~ root# rpm --import RPM-GPG-KEY-CentOS-6
  8. Remove RHEL packages

    If the ‘rpm -e’ command fails saying one of the packages is not installed remove the package from the command and run it again.

    localhost:~ root# yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes*
    localhost:~ root# rpm -e --nodeps redhat-release-server-6Server redhat-indexhtml
  9. Remove any left over RHEL subscription information and the subscription-manager

    If you do not do this every time you run ‘yum’ you will receive the following message: “This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.”

    localhost:~ root# subscription-manager clean
    localhost:~ root# yum remove subscription-manager
  10. Force install the CentOS RPMs we downloaded
    localhost:~ root# rpm -Uvh --force *.rpm
  11. Clean up yum one more time and then upgrade
    localhost:~ root# yum clean all
    localhost:~ root# yum upgrade
  12. Reboot your server
  13. Verify functionality
  14. Delete VM Snapshot if you took one as part of the backup




36 thoughts on “How to convert RHEL 6.x to CentOS 6.x”

  1. I’m encountering an error with step 8:

    yum remove rhnlib

    The message is:

    riskpp@fred$ sudo yum remove rhnlib
    Setting up Remove Process
    Resolving Dependencies
    –> Running transaction check
    —> Package rhnlib.noarch 0:2.5.22-12.el6 will be erased
    –> Processing Dependency: rhnlib >= 2.5.20 for package: rhn-client-tools-
    –> Running transaction check
    —> Package rhn-client-tools.noarch 0: will be erased
    –> Processing Dependency: rhn-client-tools = for package: rhn-setup-
    –> Processing Dependency: rhn-client-tools >= 1.0.0-62 for package: yum-rhn-plugin-0.9.1-43.el6.noarch
    –> Processing Dependency: rhn-client-tools = for package: rhn-check-
    –> Running transaction check
    —> Package rhn-check.noarch 0: will be erased
    –> Processing Dependency: rhn-check >= 0.0.8 for package: rhnsd-4.9.3-2.el6.x86_64
    —> Package rhn-setup.noarch 0: will be erased
    —> Package yum-rhn-plugin.noarch 0:0.9.1-43.el6 will be erased
    –> Running transaction check
    —> Package rhnsd.x86_64 0:4.9.3-2.el6 will be erased
    –> Finished Dependency Resolution
    YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
    Eg. 6Server is not a valid and current release or hasnt been released yet/
    removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6Server.10/base/mirrorlist.txt
    Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
    You could try using –skip-broken to work around the problem
    You could try running: rpm -Va –nofiles –nodigest

    I’m not subscribed to RHEL (the reason why I want to switch this VM over to CentOS to begin with).  I’m much more familiar with apt/aptitude than yum, but it seems like –skip-broken is non-sequitur for the problem of “no valid mirrors”.  And I’m not sure why it wants a mirrorlist anyhow, if I’m removing a package.


    Any idea how to get past this message?



    • Did you get an error on Step 6? Those packages don’t appear to be available anymore. You can get the latest ones by replacing 6.5 with 6.6 in the paths.

      That errors sounds to me like the CentOS Repo’s aren’t installed or there is something wrong with your internet connection.

    • I have tried to attempt this and used neofetch to check the system settings and it shows that the pc goes from RHEL 6 to CentOS6 but im using a vm and when I reboot my system the mount points I have fail to mount. I have one mount point that points to a backup network drive and the other is the OS. Is there anything to check on the HDD before rebooting after making these changes?

  2. Did you install “centos-release” and “centos-release-notes” and remove the redhat equivalent? It seems to be having an issue with “6server”. This is what Redhat names their servers while CentOS uses just 6. So its looking for a version of CentOS that doesn’t exist.

    • Yes. It does appear I installed “centos-release-6-5.el6.centos.11.1.x86_64.rpm” according to my documentation.

      That means I would have removed what ever rhel-release equiv was on there.

      This command should take care of the rhel equivs: “yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes*”

  3. Thank you for this tutorial, followed it and worked great. I had an issue but that was because the CentOS repo was not set up properly and OEL (Oracle Linux) packages were not removed at that time.

    • No. I believe the entire UI changes over to CentOS.

      I do not know what happens to your grub boot loader entries for certain but I imagine they stay the same.

      • Fair enough, I was just a bit curious since CentOS is so firm about staying within the law even on that point.

        Thank you for the guide!

  4. While updating from 6.4 Santiago to CentOS it got updated, but after reboot while using yum update i am getting a lot of missing dependencies. Please suggest.

  5. Hi Eric,

    Thanks for the wonderful procedure/tutorial. This helped me a lot in my project.

    But after converting RHEL6 to CentOS 6 /boot/grub/grub.conf doesnt appear on system, any idea about that?

    Thanks in advance.

    • Sorry no. That’s strange. I’ve converted over 20 servers and never lost the /boot volume. I’m thinking the issue might be unrelated to the conversion…

  6. You will also need

    As it’s a dependency of yum:
    error: Failed dependencies:
    python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-73.el6.centos.noarch

  7. I have another problem. After step 6 I got this error in yum:

    [root@KDJkramerius1 TMP]# yum
    Zavedeny zásuvné moduly: downloadonly, fastestmirror, product-id, subscription-manager
    Traceback (most recent call last):
    File “/usr/bin/yum”, line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
    File “/usr/share/yum-cli/”, line 298, in user_main
    errcode = main(args)
    File “/usr/share/yum-cli/”, line 115, in main
    File “/usr/share/yum-cli/”, line 229, in getOptionsConfig
    File “/usr/lib/python2.6/site-packages/yum/”, line 911, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
    File “/usr/lib/python2.6/site-packages/yum/”, line 335, in _getConfig
    File “/usr/lib/python2.6/site-packages/yum/”, line 564, in doPluginSetup
    plugin_types, confpath, disabled_plugins, enabled_plugins)
    File “/usr/lib/python2.6/site-packages/yum/”, line 167, in __init__‘config’)
    File “/usr/lib/python2.6/site-packages/yum/”, line 184, in run
    func(conduitcls(self, self.base, conf, **kwargs))
    File “/usr/lib/yum-plugins/”, line 30, in config_hook
    default=False, help=”don’t update, just download”)
    File “/usr/lib64/python2.6/”, line 1020, in add_option
    File “/usr/lib64/python2.6/”, line 995, in _check_conflict
    optparse.OptionConflictError: option –downloadonly: conflicting option string(s): –downloadonly

    • Did you follow all of the steps in step 6? There are multiple RPMS that have to be installed. Also did you do Step 7?

      The command you’re showing ‘yum’ doesn’t have any arguments after it like it should in Step 8.

  8. Thanks for this. It simply “just worked” for me. I did have to go back to an older Centos reposity, figuring that the initial transition should be done on the same version of RHEL that I was running. I think that was 6.7 ( It upgraded to 6.8 automatically, after that, which was fine.

    So in summary:

    yum -y update
    yum clean all
    ls -lt *.rpm
    rpm –import RPM-GPG-KEY-CentOS-6
    yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes*
    rpm -e –nodeps redhat-release-server-6Server redhat-indexhtml
    yum remove subscription-manager
    rpm -Uvh –force *.rpm
    yum clean all
    yum upgrade
    yum update (did nothing)

  9. I made the change from RH 6.3 to CentOS 6.9. I could not upgrade because the epel repository was giving “[Errno 14] problem making ssl connection”. For this it was necessary to manually update the nss packages (nspr-4.13.1-1.el6.x86_64.rpm
    nss-3.27.1-13.el6.x86_64.rpm, nss-softokn-3.14.3-23.3.el6_8.x86_64.rpm, nss-softokn-freebl-3.14.3-23.3.el6_8.x86_64.rpm, nss- sysinit-3.27.1-13.el6.x86_64.rpm,
    nss-tools-3.27.1-13.el6.x86_64.rpm, nss-util-3.27.1-3.el6.x86_64.rpm). From there I was able to upgrade.

  10. Thank you very much for this document.
    I have a question for you.

    Rpm – import rpm – GPG-key-ROOS-6

    If I write a command above,

    RPM – GPG-key- –6 : key 1 import failed

    An error will occur. What’s the cause?

  11. Thank you very much..

    I got it pretty much done, only some problem with Python.

    After upgrade to Centos 6.10 from Red Hat 6.5, still has Red Hat boot up, I am guessing that the grub is still Red Hat.

    Should this have changed in the above procedure?

  12. I see that yum was stuck in the middle of labor, the complete upgrade had not completed.

    Now that yum completed, all is updated, the baby is birthed, goodbye Red Hat. Thanks.


  13. Updating some old RHEL 6.10 servers, and I get version 6.9 in the repo files and an error after running “yum update”. [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
    Trying other mirror.

    As per here ( 6.9 is no longer supported, so you need to edit all the “BaseURL” entries in “/etc/yum.repo.d/” from “6.9” to just “6”.

    After that, “yum update” works fine.

    Reboot seems fine too…


Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.