Convert RHEL to CentOS

Some people would love to move on to Cent OS as long as they are not concerned about the Official Redhat Support and the Signed packages from the RHN repository. Today lets review the steps for converting a live Redhat Server into Cent Os with a very short process. The process involves few changes in some of the rpms and modification in few of the configuration files.

1. Remove all the existing redhat repositories and associated cached packages and headers from the server.  This will force yum to download its required files the next time the command is run.

rm -f /etc/yum.repos.d/rhel*
rm -f /var/lib/rpm/__db*
rpm –rebuilddb
yum clean all

2. Enter the following command in the terminal to create a directory to download the required CentOS release files and RPMs.

mkdir ~/centos && cd ~/centos/

3. Download RPMs for system installation for the appropriate version of CentOS. ( The RPMS may vary based on your server architecture and the version of OS you are running)

4. Import the GPG key for CentOS which is downloaded before

rpm –import RPM-GPG-KEY-CentOS-6

5. Remove the RHEL release files

rpm -e –nodeps redhat-release-server

6. Remove the RedHat Network plugin for yum.

rpm -e yum-rhn-plugin

7. Remove other RedHat Network files

rpm -e rhn-check rhnsd rhn-setup rhn-setup-gnome –nodeps

8. Install all the new CentOS  RPMs to convert the system.

rpm -Uvh –force *.rpm

9. Upgrade the yum to download the new set of header files.

yum upgrade

10. Change the grub entries to list the title as CentOS

sed -i s/Red\ Hat\ Enterprise\ Linux/CentOS/g /etc/grub.conf
sed -i s/Red\ Hat\ Enterprise\ Linux/CentOS/g /boot/grub/grub.conf

11. Remove if any of the Redhat repository files exist in yum.conf.d ( Optional )

rm -rf /etc/yum.repos.d/redhat*

12. Remove the Redhat Logos as well if required.

rpm -e redhat-logos –nodeps

13. Now Reboot the system , verify the new CentOs installations and confirm that there are no redhat release rpms exist !