Converting RHEL 4 to CentOS 4

From MyWiki

Jump to: navigation, search

The foolowing steps are in reference to Converting RHEL 4 to CentOS 4.

  • First I did the Red Hat package Updating Your System:
 up2date --nox -u

You can, if necessary, temporarily "borrow" a license from another server via the rhn.redhat.com web site. Then I rebooted and continued with the final "forced" update:

 up2date --nox --update --forced

I would have rebooted a second time if anything had been forcibly updated.

  • To expedite the Downloading Required Packages section, I browsed to the correct page for based on the linux version, then copied the link and pasted it into the ssh window prefixed by wget:
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/centos-release-4-7.i386.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/python-elementtree-1.2.6-5.el4.centos.i386.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/python-sqlite-1.1.7-1.2.1.i386.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/python-urlgrabber-2.9.8-2.noarch.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/sqlite-3.3.6-2.i386.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm
 wget ftp://mirror.ucsd.edu/centos/4/os/i386/CentOS/RPMS/yum-metadata-parser-1.0-8.el4.centos.i386.rpm

Of course, these URLs will be different for x86_64 or future releases (current as of 2008-Dec-07.)

  • Removing RHEL Packages

Next, you have to remove some specific packages from Red Hat. As root, run the following commands on your system:

 rpm -e --nodeps redhat-release
 rpm -e rpmdb-redhat
 service rhnsd stop
 chkconfig rhnsd off

Note that on the original page, the final command above has been corrected. You can check via:

 chkconfg --list rhnsd
  • Installing CentOS GPG Key
 wget http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
 rpm --import RPM-GPG-KEY-centos4
  • Installing CentOS Packages

Change into the temporary directory you created for the packages you downloaded above (cd) and run the following as root:

 rpm -Uvh *.rpm

You can check to make sure they installed correctly:

 rpm -qa  | egrep 'yum|splite|centos|python\-'

which also will display additional installed packages.

  • Updating With CentOS Package
Once you've upgraded the necessary packages from the set that you downloaded manually, you can let yum take over and finish the job for you. Run the following two command as root:
 yum clean all
 yum -y update

The yum -y update may or may not download anything, so do not be alarmed if it doesn't do anything. That simply means your system's packages are up to date with the latest available versions provided by CentOS.

  • Reboot to make sure it all works okay.

or perhaps as easy as:

 service yum start

to start yum-cron

  • Delete or comment out root's up2date crontab entry:
 crontab -e
Personal tools