upgrading centos4 to 5

Note: There is a risk the below can leave your server unbootable. I have personally used this method multiple times with out issues, but you may run into unexpected problems with RPM conflicts that are not covered here.

This tutorial is for upgrading from centos 4 to centos 5. InterServer customers can contact support to have this done. For centos 3 to 4 see http://www.interserver.net/forum/threads/upgrading-centos-3-to-4.248/

cPanel Users: The exclude line in yum.conf needs to be commented out. When done add it back it. Make sure to reinstall perl from layer1.cpanel.net as well as rerun easyapache.

A custom kernel should be installed from source. This is not covered here.

The following RPM’s may need to be removed

jfsutils

bg5ps

VFlib2 ghostscript ghostscript-fonts hpijs gimp-print

netpbm-prog

xalan-j mx4j commons-modeler

On dag repo / rpmforge servers I found the following needed to be removed

lksctp-tools

imlib2-devel ffmpeg-devel

libsndfile twolame mencoder

Step 1: Remove conflicting rpm


rpm -e --justdb python-elementtree --nodeps

The upgrade will not work with the above RPM installed, but the contents is still needed so we call it with justdb because the file contents are needed. This will be reinstalled at a later time in one of the below steps.

Step 2:
Remove old kernels


for i in `rpm -qa | grep -i kernel-2.6.9`; do rpm -e $i --nodeps; done

for i in `rpm -qa | grep -i kernel-smp-2.6.9`; do rpm -e $i --nodeps; done

kernel-hugemem may be installed as well

Step 3: Update yum.conf (expects replace to be installed)


cd /etc/yum.repos.d

replace vault.centos.org/4.9 mirror.trouble-free.net/centos/\$releasever -- *

# rpm stuff

rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

cp -a /var/lib/rpm /var/lib/rpm.centos4


Step 4: Run yum


yum clean all

yum upgrade

Step 5: Add back in needed rpm’s. When we removed python-elementtree the following files were left behind

/usr/lib/python2.3/site-packages/cElementTree.so

/usr/lib/python2.3/site-packages/elementtree

/usr/lib/python2.3/site-packages/elementtree/ElementInclude.py

/usr/lib/python2.3/site-packages/elementtree/ElementInclude.pyc

/usr/lib/python2.3/site-packages/elementtree/ElementInclude.pyo

/usr/lib/python2.3/site-packages/elementtree/ElementPath.py

/usr/lib/python2.3/site-packages/elementtree/ElementPath.pyc

/usr/lib/python2.3/site-packages/elementtree/ElementPath.pyo

/usr/lib/python2.3/site-packages/elementtree/ElementTree.py

/usr/lib/python2.3/site-packages/elementtree/ElementTree.pyc

/usr/lib/python2.3/site-packages/elementtree/ElementTree.pyo

/usr/lib/python2.3/site-packages/elementtree/HTMLTreeBuilder.py

/usr/lib/python2.3/site-packages/elementtree/HTMLTreeBuilder.pyc

/usr/lib/python2.3/site-packages/elementtree/HTMLTreeBuilder.pyo

/usr/lib/python2.3/site-packages/elementtree/SgmlopXMLTreeBuilder.py

/usr/lib/python2.3/site-packages/elementtree/SgmlopXMLTreeBuilder.pyc

/usr/lib/python2.3/site-packages/elementtree/SgmlopXMLTreeBuilder.pyo

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLTreeBuilder.py

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLTreeBuilder.pyc

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLTreeBuilder.pyo

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLWriter.py

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLWriter.pyc

/usr/lib/python2.3/site-packages/elementtree/SimpleXMLWriter.pyo

/usr/lib/python2.3/site-packages/elementtree/TidyHTMLTreeBuilder.py

/usr/lib/python2.3/site-packages/elementtree/TidyHTMLTreeBuilder.pyc

/usr/lib/python2.3/site-packages/elementtree/TidyHTMLTreeBuilder.pyo

/usr/lib/python2.3/site-packages/elementtree/TidyTools.py

/usr/lib/python2.3/site-packages/elementtree/TidyTools.pyc

/usr/lib/python2.3/site-packages/elementtree/TidyTools.pyo

/usr/lib/python2.3/site-packages/elementtree/XMLTreeBuilder.py

/usr/lib/python2.3/site-packages/elementtree/XMLTreeBuilder.pyc

/usr/lib/python2.3/site-packages/elementtree/XMLTreeBuilder.pyo

/usr/lib/python2.3/site-packages/elementtree/__init__.py

/usr/lib/python2.3/site-packages/elementtree/__init__.pyc

/usr/lib/python2.3/site-packages/elementtree/__init__.pyo

/usr/share/doc/python-elementtree-1.2.6

/usr/share/doc/python-elementtree-1.2.6/CHANGES

/usr/share/doc/python-elementtree-1.2.6/CHANGES-cElementTree

/usr/share/doc/python-elementtree-1.2.6/README

/usr/share/doc/python-elementtree-1.2.6/README-cElementTree

/usr/share/doc/python-elementtree-1.2.6/benchmark.py

/usr/share/doc/python-elementtree-1.2.6/docs

/usr/share/doc/python-elementtree-1.2.6/docs/effbot.css

/usr/share/doc/python-elementtree-1.2.6/docs/index.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.ElementInclude.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.ElementPath.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.ElementTree.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.HTMLTreeBuilder.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.SgmlopXMLTreeBuilder.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.SimpleXMLTreeBuilder.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.SimpleXMLWriter.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.TidyTools.html

/usr/share/doc/python-elementtree-1.2.6/docs/pythondoc-elementtree.XMLTreeBuilder.html

/usr/share/doc/python-elementtree-1.2.6/samples

/usr/share/doc/python-elementtree-1.2.6/samples/simple-ns.xml

/usr/share/doc/python-elementtree-1.2.6/samples/simple.xml

Below we are reinstalling python-elementree but there is the possibility one of the above files is no longer provided by the new python-elementtree. You may want to clean up the above files. It is not required.


rpm -Uvh http://mirror.trouble-free.net/centos/5/os/i386/CentOS/python-sqlite-1.1.7-1.2.1.i386.rpm --force

rpm -Uvh http://mirror.trouble-free.net/centos/5/os/i386/CentOS/python-elementtree-1.2.6-5.i386.rpm --force

rpm -Uvh http://mirror.trouble-free.net/centos/5/os/i386/CentOS/sqlite-3.3.6-5.i386.rpm --force


Step 5: Dev entries (May not be required)


MAKEDEV urandom

MAKEDEV sda

MAKEDEV console

MAKEDEV null

MAKEDEV ptmx

MAKEDEV pty

mount /dev/pts


Step 6: Rerun yum


yum clean all

yum update

On cpanel servers at this point perlinstaller needs to be rerun as well as an apache/php rebuild, then an upcp.

Leave a Reply

Your email address will not be published. Required fields are marked *