Tuesday, January 8, 2008

Upgrade Fedora Core 4 To Core 5

The following steps were used to update a Fedora Core 4 system to Fedora Core 5 using yum.

1. Make sure yum is up to date. If you are going to upgrade your system with it, you might as well make sure the tool is up to pars.
#yum -y upgrade yum
This is going to download a bunch of other stuff other than yum. So be patient.

2a. Next, make sure sure your kernel is up to date as well. Or else when you upgrade to FC5, it will throw a bunch of errors like this:
Error: Package initscripts needs kernel <2.6.12, this is not available.

Error: Package kudzu needs kernel < 2.6.13, this is not available.


So here we go:
#yum -y upgrade kernel
For multi-CPU systems, do the following instead:
#yum -y upgrade kernel-smp

If this step fails, I recommend running the following command to capture all screen output to /tmp/yum_upgrade.
# yum upgrade 2>&1 tee /tmp/yum_upgrade

Failures generally indicate that a currently-installed RPM has a dependency that cannot be satisfied with packages from the new Fedora Core release. Deprecated packages and packages from third party repositories may cause this problem.

The following generates a list of packages that may need to be removed prior to a successful yum upgrade.
$ perl -ne 'print "$1\n" if ((/Error: Missing Dependency:.*is needed by package (.*)$/) (/Error: Package (.*?) needs.*, this is not available./))' /tmp/yum_upgrade sort uniq

3. If the initscripts package is returned, I recommend booting into the latest Fedora Core 4 kernel, removing all previous kernels, and running yum upgrade again.

4a. Now delete any old kernels you have still on your system. First, let’s see what’s there:
#rpm -q kernel kernel-smp kernel-devel kernel-smp-devel sort

4b. Delete old kernels:
#rpm -e kernel-version-number
I read somewhere that you should delete kernels by using rpm since it also tidies up your bootloader file for you.

Optional: Update rpm packages:
#rpm --rebuilddb

5. Now ready to get Fedora Core 5 upgrade package. Download and install the Fedora Core 5 version of fedora-release from one of the Fedora Core mirrors.
Example:
# rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os/Fedora/RPMS/fedora-release-5-5.noarch.rpm

6. Upgrade to Fedora Core 5.
# yum -y upgrade


7. Reboot the system to begin using Fedora Core 5.
# reboot