Ashish Jaiswal Blog

A blog dedicated to community

Convert CentOS/Scientific Linux to RHEL Server

We have ran into scenario where we wanted to convert a CentOS box to RHEL box. So sharing my experience out here.

There are some pre-requisite

Terminal
1
2
3
rpm -qa centos\*
centos-indexhtml-6-1.el6.centos.noarch
centos-release-6-5.el6.centos.11.2.x86_64

We will need some redhat packages to start off. You can retrive this packages from installation media or you can logging to RHN and download these packages.

Terminal
1
2
3
4
5
6
7
8
9
10
11
12
13
libgudev1-147-2.51.el6.x86_64.rpm
pygobject2-2.20.0-5.el6.x86_64.rpm
redhat-release-server-6Server-6.5.0.1.el6.x86_64.rpm
rhn-setup-1.0.0.1-8.el6.noarch.rpm
yum-rhn-plugin-0.9.1-49.el6.noarch.rpm
m2crypto-0.20.2-9.el6.x86_64.rpm
python-dmidecode-3.10.13-3.el6_4.x86_64.rpm
rhn-check-1.0.0.1-8.el6.noarch.rpm
rhnlib-2.5.22-15.el6.noarch.rpm
pyOpenSSL-0.10-2.el6.x86_64.rpm
python-gudev-147.1-4.el6_0.1.x86_64.rpm
rhn-client-tools-1.0.0.1-8.el6.noarch.rpm
rhnsd-4.9.3-2.el6.x86_64.rpm
  1. First we will remove CentOS packages
Terminal
1
 rpm -e --nodeps centos-release centos-indexhtml pygobject2 pyOpenSSL libgudev1
  1. Install those redhat packages, I had these packages at /root/rhel, after installing those packages we will clean yum cache.
Terminal
1
2
3
 cd /root/rhel
  rpm -ivh *
  yum clean all
  1. Then you will have to register the box to RHN
Terminal
1
2
rhn_register
cat /etc/redhat-release
  1. Just assigning an optional channel to RHEL box.
Terminal
1
rhn-channel -a -c rhel-x86_64-server-optional-6
  1. Just run an update, to get updates from RedHat Network
Terminal
1
yum update
  1. The below command, will put all the other packages names with version number, and we will reinstall those with RedHat repository
Terminal
1
2
rpm -qa --qf "%{NAME} %{VENDOR}\n" | grep CentOS | cut -d' ' -f1 | grep -v ^kernel | sort | tee lst
yum reinstall $(cat lst)
  1. We will run a distro-sync for the left out package.
Terminal
1
yum distro-sync
  1. Just to ensure if there is any left out package which is not reinstall from RedHat repos. In some case there maybe some, just subscribe to those required channels and your are good to go. Then just reboot the box.
Terminal
1
2
3
4
5
rpm -qa --qf "%{NAME} %{VENDOR}\n" | grep CentOS | cut -d' ' -f1 | grep -v ^kernel | wc -l
0
yum update
No Packages marked for Update
yum repolist

http://blog.famillecollet.com/post/2013/09/21/Switch-from-CentOS-6.4-to-RHEL-6.4

Comments