Options

How to: Convert RHEL to CentOS

jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
I honestly don't know who asked me, but I had a PM a while back asking me if I know how to do that (he probably sent it to other people as well).

Anyway, here is the promised how-to for whoever asked (deleted all PMs, sorry).

I created a script for 32Bit and 64Bit a while back .. so either copy all that into an .sh file (and make it executable) or copy / execute each line (except for the comments obviously).

Mind you, this is for CentOS 5.4 - you will need to change he package names accordingly if you do this for different version.

RHEL 5.4 > CentOS 5.4 - 32 Bit
# Create Folder
mkdir ~/convert/
cd ~/convert/

# Rebuild the RPM Database and cleanup Yum 
rm -f /etc/yum.repos.d/rhel-debuginfo.repo
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
yum clean all

# Import Public Key from CentOS
su -c 'rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5'

[IMG]http://i46.tinypic.com/2cmqlpz.jpg[/IMG]
(could not post links as the forums errors out on me, hence the screenshot)

# Change the bootloader to read CentOS rather than RedHat
find /boot/grub -name "grub.conf" -exec sed -i 's/Red Hat Enterprise Linux Server/Centos 5.4/g' {} \;

# Changing Boot Splash Screen to be CentOS rather than Redhat
cp -f splash.xpm.gz /boot/grub

# Remove unnecessary RedHat packages
rpm -e --nodeps redhat-release
rpm -e --nodeps yum-rhn-plugin

# Install new CentOS packages
rpm --force -Uvh *.rpm

# Update CentOS
yum update -y

RHEL 5.4 > CentOS 5.4 - 64 Bit
# Create Folder
mkdir ~/convert/
cd ~/convert/

# Rebuild the RPM Database and cleanup Yum 
rm -f /etc/yum.repos.d/rhel-debuginfo.repo
rm -f /var/lib/rpm/__db*
rpm --rebuilddb
yum clean all

# Import Public Key from CentOS
su -c 'rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5'

[IMG]http://i50.tinypic.com/9rqd0o.jpg[/IMG]
(could not post links as the forums errors out on me, hence the screenshot)

# Change the bootloader to read CentOS rather than RedHat
find /boot/grub -name "grub.conf" -exec sed -i 's/Red Hat Enterprise Linux Server/Centos 5.4/g' {} \;

# Changing Boot Splash Screen to be CentOS rather than Redhat
cp -f splash.xpm.gz /boot/grub

# Remove unnecessary RedHat packages
rpm -e --nodeps redhat-release
rpm -e --nodeps yum-rhn-plugin

# Install new CentOS packages
rpm --force -Uvh *.rpm

# Update CentOS
yum update -y

Files can also be download from the official CentOS Mirror

Index of /centos/5/os

Here are the scripts as text file :

http://ifinallygotitworking.co.uk/customfiles/convertrhel/Convert-RHEL-CentOS-32Bit.txt
http://ifinallygotitworking.co.uk/customfiles/convertrhel/Convert-RHEL-CentOS-64Bit.txt

Needless to say I don't take any responsibility if this breaks your system - always make sure you have backups / snapshots etc.

Here a few screenshots

Prior conversion you can see that everything shows RHEL 5.4 with updates disabled as the system is not registered in RHN

RHELx64-2010-01-13-12-25-43.png

RHELx64-2010-01-13-12-26-27.png

RHELx64-2010-01-13-12-26-54.png

RHELx64-2010-01-13-12-27-18.png

Make sure everything runs through without errors

RHELx64-2010-01-13-12-36-37.png

After the conversion and a reboot you can see everything is CentOS 5.4 running the latest kernel (to date).

RHELx64-2010-01-13-12-37-13.png

RHELx64-2010-01-13-12-37-55.png

RHELx64-2010-01-13-12-38-43.png
My own knowledge base made public: http://open902.com :p

Comments

  • Options
    jibbajabbajibbajabba Member Posts: 4,317 ■■■■■■■■□□
    Meh .. downloads won't be working for you as I forgot that the domain currently points to the private IP of the server. I changed that but DNS propagation will take approx 24-48 hours ... (plus you won't see the screenshots)

    You can get them now if you change your hostfile to

    85.232.40.76 ifinallygotitworking.co.uk

    or wait 24-48 hours icon_sad.gif
    My own knowledge base made public: http://open902.com :p
Sign In or Register to comment.