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!
- Fully patch your system and reboot your system before starting this process
- Take a full backup of your system or a Snapshot if it’s a VM
- Login to the server and become root
- Clean up yum’s cache
localhost:~ root# yum clean all
- Create a temporary working area
localhost:~ root# mkdir -p /temp/centos localhost:~ root# cd /temp/centos
- Determine your version of RHEL
localhost:~ root# cat /etc/redhat-release
- Determine your architecture (32-bit = i386, 64-bit = x86_64)
localhost:~ root# uname -i
- 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
- Import the GPG key for the appropriate version of CentOS
localhost:~ root# rpm --import RPM-GPG-KEY-CentOS-6
- 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
- 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
- Force install the CentOS RPMs we downloaded
localhost:~ root# rpm -Uvh --force *.rpm
- Clean up yum one more time and then upgrade
localhost:~ root# yum clean all localhost:~ root# yum upgrade
- Reboot your server
- Verify functionality
- Delete VM Snapshot if you took one as part of the backup