Convert RedHat to CentOS

Overview

SoftLayer users have the option to convert their RedHat Enterprise Linux (RHEL) operating system to CentOS at any time.  CentOS is a free OS based on Linux and works to maintain complete binary compatibility with RHEL to keep the user experience between RHEL and CentOS as similar as possible, aside from a few minor differences.  The Convert RHEL to CentOS procedure outlines the steps required to convert the version of RHEL installed on your machine to a similar version of CentOS.  The following OS versions are currently compatible and are covered in this procedure:

  • RHEL 5.x to CentOS 5.x
  • RHEL 6.x to CentOS 6.x

Important Notes: This procedure makes a serious change to the operation of your system; complete backups should be taken prior to attempting the conversion.  Also, note that if you have cPanel installed on a RedHat system, you will not be able to do this conversion and it will require a full OS reload instead. If you do not feel comfortable performing the steps below, please contact our Sales team to order a new system and migrate your content. Lastly, a ticket will need to be opened in order to correct billing items associated with the server since CentOS is free of charge whereas RedHat is not.

Follow the steps below to convert RHEL to CentOS.

Example

Disclaimer: This example doesn't apply for all transitions being attempted.


1. Login to the server as 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: http://mirror.centos.org/centos/6/os/i386/Packages/ (32-bit) or http://mirror.centos.org/centos/6/os/x86_64/Packages/ (64-bit) and replace the ‘x’ values below with the current version numbers


CentOS 6.5 / 32-bit

localhost:~ root# wget http://mirror.centos.org/centos/6/os/i386/RPM-GPG-KEY-CentOS-6 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/i386/Packages/centos-release-6-x.el6.centos.x.x.i686.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/i386/Packages/centos-indexhtml-6-x.el6.centos.noarch.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/i386/Packages/yum-x.x.x-x.el6.centos.noarch.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/i386/Packages/yum-plugin-fastestmirror-x.x.x-x.el6.noarch.rpm

 

CentOS 6.5 / 64-bit

localhost:~ root# wget http://mirror.centos.org/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-release-6-x.el6.centos.xx.x.x86_64.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/centos-indexhtml-6-x.el6.centos.noarch.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-x.x.xx-xx.el6.centos.noarch.rpm 

localhost:~ root# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-x.x.xx-xx.el6.noarch.rpm

 

7. Import the GPG key for the appropriate version of CentOS

localhost:~ root# rpm --import RPM-GPG-KEY-CentOS-6

 

8. Remove RHEL packages

Note: 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

Note: 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