July 15, 2009

Update RHEL 4 with CentOS 4

If you would like to update your Red Hat Enterprise 4 server with the latest CentOS 4 repositories, here are some step-by-step command lines.
# cd /usr/src/
# wget http://www.gtlib.gatech.edu/pub/centos/4.7/os/x86_64/CentOS/RPMS/up2date-4.7.1-17.el4.centos.x86_64.rpm
# wget http://www.gtlib.gatech.edu/pub/centos/4.7/os/x86_64/CentOS/RPMS/centos-release-4-7.x86_64.rpm
# cp /etc/sysconfig/rhn/up2date /etc/sysconfig/rhn/up2date.redhat
# rpm -ev up2date-gnome rhn-applet
# rpm -Uhv centos-release-4-7.x86_64.rpm up2date-4.7.1-17.el4.centos.x86_64.rpm
# cp /etc/sysconfig/rhn/up2date.rpmnew /etc/sysconfig/rhn/up2date.centos
# cp /etc/sysconfig/rhn/up2date.centos /etc/sysconfig/rhn/up2date
# vim /etc/sysconfig/rhn/sources
# rpm --import /usr/share/rhn/RPM-GPG-KEY
# up2date-nox --update
# up2date-nox -f kernel
# vim /etc/grub.conf
# reboot

Converting from RHEL to CentOS only makes sense on older, semi-retired machines.

3 comments:

Moshe Linzer said...

why do you say that?

Gavin said...

I say it because changing distributions is a major update and could break your system. You are taking the system off Red Hat support, which I require for critical systems. Also, supporting Red Hat is a good thing and helps all Linux.

Anonymous said...

I know it's good for me as a contractor because not having a smooth upgrade path available for free makes me more money that 'apt-get update'

Good for linux as a whole is debatable (not interested in doing so, just think acknowledging it is good)