How to convert RHEL 5.x to CentOS 5.x

Last modified: [last-modified]

We’ve got a semi-large fleet of Redhat Enterprise Linux (RHEL) 5 and 6 servers where I work and we want to convert them over to CentOS to save on licensing costs.

I searched around online and found a few guides on how to do it but ultimately I had to pull from all three and make a few tweaks to get everything working.

I’ve used these steps to convert a single 32-bit RHEL 5 system to CentOS 5. These instructions should also work for the 64-bit version. I will have another post in the coming days on how to do this with RHEL 6/CentOS 6.

If you’re using RHEL 6.x and want to convert to CentOS 6.x check out this post

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

Conversion

  1. Login to the server and become root
  2. Clean up yum’s cache
  3. Create a temporary working area
  4. Determine your version of RHEL
  5. Determine your architecture (32-bit = i386, 64-bit = x86_64)
  6. Download the applicable files for your release and architecture. The version numbers on these packages could change. This document was written as of CentOS 5.10. To find the current versions of these files browse this FTP site: http://mirror.centos.org/centos/5/os/i386/CentOS/ (32-bit) and http://mirror.centos.org/centos/5/os/x86_64/CentOS/ (64-bit)
    CentOS 5.10 / 32-bit

    CentOS 5.10 / 64-bit
  7. Import the GPG key for the appropriate version of CentOS
  8. Remove the RHEL release files
  9. Remove the Redhat Network plugin for yum
  10. Removing the remaining RHEL files that may be install on the system

    Note: If this command fails saying a package is not installed remove the package from the command and run it again.
  11. Install the CentOS RPMs we downloaded previously (make sure you are still in /temp/centos)
  12. Upgrade to CentOS from RHEL
  13. Reboot the server
  14. Verify functionality
  15. Delete the VM Snapshot if you took one as part of the backup.

If you’re running a GUI on your server

We’re running Gnome on our servers and after performing the following error is displayed:

and looks like this:

RHEL Theme Error

To fix it follow these steps:

  1. Click past the messages and get to the login screen and login
  2. Click ‘System’ and ‘Administration’ and ‘Login Screen’
  3. Select ‘CentOS Default’ so there is a dot beside it
  4. Click ‘Close’
  5. Press CTRL+ALT+BACKSPACE on your keyboard and the desktop should reload to the login screen with no error

References

5 thoughts on “How to convert RHEL 5.x to CentOS 5.x

Leave a Reply

Your email address will not be published. Required fields are marked *