Upgrading CentOS 4 to 5

Quags

Administrator
Staff member
Update 2/4/13 - Some version changes due to centos 5.9 update

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

Code:
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

Code:
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)

Code:
# need yum (change based on os in use) these may update as centos5 changes
rpm -Uvh http://mirror.trouble-free.net/centos/5/os/i386/CentOS/centos-release-5-9.el5.centos.1.i386.rpm http://mirror.trouble-free.net/centos/5/os/i386/CentOS/centos-release-notes-5.9-0.i386.rpm

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

Code:
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.

These versions may change in the future as centos5 updates.
Code:
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-6.i386.rpm --force
Step 5: Dev entries (May not be required)

Code:
MAKEDEV urandom
MAKEDEV sda
MAKEDEV console
MAKEDEV null
MAKEDEV ptmx
MAKEDEV pty
mount /dev/pts
Step 6: Rerun yum

Code:
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.
 

Quags

Administrator
Staff member
I have done this upgrade many times. Today I ran into an issue on a PHP recompile

Code:
'grep: /usr/lib/libidn.la: No such file or directory
/bin/sed: can't read /usr/lib/libidn.la: No such file or directory
libtool: link: `/usr/lib/libidn.la' is not a valid libtool archive
make: *** [libphp5.la] Error 1' That happened after using 'make'
The issue was /opt/curlssl

Either reinstall curl to /opt/curlssl or do

mv /opt/curlssl /opt/curlssl.old

And rerun easyapache
 
Top