Archive for February, 2010

CentOS to Redhat

Friday, February 5th, 2010

Before you begin, you will need the following files the Official RedHat CD/DVD/site.
redhat-release-5Server
rhel-instnum
rhn-check
rhn-client-tools
rhnlib
rhnsd
rhn-setup
yum-rhn-plugin

Migrating from CentOS v5.4 to RedHat v5.4
Step 1: Install CentOS
Also verify you have the package pyOpenSSL installed
If not, type “yum install pyOpenSSL” as root without the quotes.

Step 2: Remove CentOS specific files
Next remove the current centos rpms from the database
# rpm -e centos-release –nodeps
# rpm -e centos-release-notes

If this doesn’t work, add the –justdb option.

Clean the yum in case you’ve used it:
# yum clean all

Step 3: Install the RedHat files

Install the files mentioned above from Redhat.
# rpm –ivh redhat-release-5Server-5.4.0.3.i386.rpm rhnlib-2.2.7-2.el5.noarch.rpm rhel-instnum-1.0.9-1.el5.noarch.rpm rhnsd-4.7.0-4.el5.i386.rpm rhn-check-0.4.20-9.el5.noarch.rpm rhn-setup-0.4.20-9.el5.noarch.rpm rhn-client-tools-0.4.20-9.el5.noarch.rpm yum-rhn-plugin-0.5.4-13.el5.noarch.rpm

Register you system with the rhn_reg or copy the systemid to the Redhat directory (see previous blog entry)

Remove or disable the repositories in the /etc/yum.conf.d directory

Note: If you have other rpm add-ons (such as trixbox repositories) that were originally CentOS centric and you still want to use them, then you’ll have to edit the repos. Change the $releasever to a “5” without the quotes.

Update your system:
# yum update

RedHat Repositories

Monday, February 1st, 2010

Situation: You are not the administrator of your server Redhat repository and the administrator takes a couple weeks to get back to you. You have to quickly rebuild your server in case of failure or for a test environment.

Solution: Backup the /etc/sysconfig/rhn/systemid to another location. Restore the file to the same exact server after rebuilding, verify permissions are correct (chmod 644), and you’re back in business.