CentOS 5 has been out for a little while now and I still haven’t had a chance to install and play with it. Today, though, I was able to make excuse to start on it. I actually created it on a virtual server though, and it’s much easier for me to just copy an existing file system over to a new virtual server than it is to create an entirely new file system. So, I started googling for ways to upgrade rather than do a fresh install.
I came across these instructions on how to upgrade an x86_64 architecture, and kindof adapted them to the i386 architecture that I was using. There was lots of trial an error to get it working, but overall it only took about two hours. I’m looking back in my history to make sure I got all of the important stuff. These instructions are based off of that. I’ll revise the instructions to get more exact the next time I try this.
Note, the CentOS5 mirror that I used can be changed for a mirror of your choice. If you are going to be doing this more than a couple times, I’d suggest setting up your own private repository so that you just download everything once. You can use this command to rsync to your local mirrors server:
/usr/bin/rsync -aqzH --delete mirror.chpc.utah.edu::CentOS/5.0/ /home/mirrors/centos/5.0
Again, adjust the mirror server to one that is close to you. You can find a good one on this list
Remove un-necessary packages
yum erase http* php* mysql* autofs glibc-kernheaders
Download and install the centos-release stuff:
wget http://centos.sd2.mirrors.redwire.net/5.0/os/i386/CentOS/centos-release-notes-5.0.0-2.i386.rpm
wget http://centos.sd2.mirrors.redwire.net/5.0/os/i386/CentOS/centos-release-5-0.0.el5.centos.2.i386.rpm
rpm -Uvh centos-release*
Install the CentOS5 GPG Key
rpm --import http://mirrors.kernel.org/centos/RPM-GPG-KEY-CentOS-5
Create a file called ‘files’ and add this content:
rpm-libs-4.4.2-37.el5.i386.rpm
rpm-4.4.2-37.el5.i386.rpm
yum-3.0.5-1.el5.centos.2.noarch.rpm
rpm-python-4.4.2-37.el5.i386.rpm
popt-1.10.2-37.el5.i386.rpm
glibc-2.5-12.i386.rpm
glibc-common-2.5-12.i386.rpm
beecrypt-4.1.2-10.1.1.i386.rpm
glibc-headers-2.5-12.i386.rpm
glibc-devel-2.5-12.i386.rpm
binutils-2.17.50.0.6-2.el5.i386.rpm
elfutils-libelf-0.125-3.el5.i386.rpm
elfutils-0.125-3.el5.i386.rpm
elfutils-libs-0.125-3.el5.i386.rpm
beecrypt-python-4.1.2-10.1.1.i386.rpm
python-2.4.3-19.el5.i386.rpm
python-devel-2.4.3-19.el5.i386.rpm
python-elementtree-1.2.6-5.i386.rpm
python-sqlite-1.1.7-1.2.1.i386.rpm
python-urlgrabber-3.1.0-2.noarch.rpm
neon-0.25.5-5.1.i386.rpm
libxml2-2.6.26-2.1.2.i386.rpm
libxml2-python-2.6.26-2.1.2.i386.rpm
db4-4.3.29-9.fc6.i386.rpm
libselinux-1.33.4-2.el5.i386.rpm
libsepol-1.15.2-1.el5.i386.rpm
mcstrans-0.1.10-1.el5.i386.rpm
m2crypto-0.16-6.el5.1.i386.rpm
krb5-libs-1.5-17.i386.rpm
openssl-0.9.8b-8.3.el5.i386.rpm
readline-5.1-1.1.i386.rpm
Then run this to download them all:
for file in `cat files`
do
wget http://centos.sd2.mirrors.redwire.net/5.0/os/i386/CentOS/$file
done
Then install them all:
rpm -Uvh *.rpm --nodeps
Clean up some old stuff:
rm -f /var/lib/rpm/__*
rpm --rebuilddb
yum clean all
Download and install the new kernel (This doesn’t do anything for me since I’m on a virtual server who’s kernel is controlled by the host. But it’s already running 2.6.20, so it should have any features that 2.6.18 uses)
wget http://centos.sd2.mirrors.redwire.net/5.0/os/i386/CentOS/kernel-2.6.18-8.el5.i686.rpm
wget http://centos.sd2.mirrors.redwire.net/5.0/os/i386/CentOS/kernel-headers-2.6.18-8.el5.i686.rpm
rpm -ivh kernel-* --nodeps
Now upgrade all of the packages:
yum upgrade
And re-install stuff that you removed before starting:
yum install mysql mysql-server httpd php