Upgrading Red Hat Linux/Fedora Core with yum
It is possible to upgrade your Red Hat Linux/Fedora Core system using yum instead of the
CD/DVD-based install or
upgrade option. Only experienced Red Hat/Fedora
Core users should attempt this, as the yum upgrade process is not officially supported and may cause
problems.
Theoretically, you should be able to upgrade from any Red Hat
Linux/Fedora Core
release to any Red Hat Linux/Fedora Core release with a yum-compatible repository
(i.e. containing yum "header"
files). I have successfully upgraded the following operating system
releases using yum:
- Red Hat Linux 7.2 to 9
- Red Hat Linux 8.0 to 9
- Red Hat Linux 8.0 to Fedora Core 2
- Red Hat Linux 9 to Fedora Core 1
- Fedora Core 1 to Fedora Core 2
- Fedora Core 2 to Fedora Core 3
- Fedora Core 3 to Fedora Core 4
- Fedora Core 4 to Fedora Core 5
The steps are slightly different when upgrading to Fedora Core releases
versus a Red
Hat Linux release (i.e. through Red Hat Linux 9), so they are presented
separately.
Before performing an upgrade with yum,
please read the YumUpgradeFaq
Wiki.
The basic steps for upgrading a system to the latest Fedora Core release using yum:
1. Install the fedora-release package from the new release
2. Run yum upgrade
3. Reboot
Upgrading to Fedora Core 5
The following steps were used to update a Fedora Core 4 system to
Fedora Core 5 using yum.
1. 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
2. Upgrade to Fedora Core 5.
#
yum -y upgrade
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
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.
3. Reboot the system to begin using Fedora Core 5.
# reboot
Upgrading to Fedora Core 4
The following steps were used to update a Fedora Core 3 system to
Fedora Core 4 using yum.
1. Update yum to the latest Fedora Core 3 version.
# yum -y update yum
2. Download and install the Fedora Core 4 version of fedora-release from one of the Fedora Core
mirrors.
Example:
# rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/fedora-release-4-2.noarch.rpm
3. Disable third-party yum
repositories, if applicable.
In my configuration, I had the Dag,
FreshRPMs, and Dries third-party yum
repositories enabled. As of 2005/06/15, only the Dries repository
caused an error message (i.e. it had not been updated with Fedora Core
4 packages or it did not have a Fedora Core 4 directory structure) so I
will only disable that repository.
# echo "enabled=0" >>
/etc/yum.repos.d/dries.repo
4. When upgrading to Fedora Core 4, the kernel must be upgraded
before the rest of the packages.
# yum -y update kernel
Otherwise, you may receive the following error message:
--> Running transaction check
--> Processing Dependency:
kernel-utils for package: kernel
--> Finished Dependency
Resolution
Error: Missing Dependency:
kernel-utils is needed by package kernel
5. Disable SELinux, if applicable, and reboot the system to begin using
the Fedora Core 4 kernel. I
ran into significant problems after this reboot when SELinux was
enabled.
To disable SELinux:
# vi /etc/sysconfig/selinux
Change:
SELINUX=enforcing
-- or --
SELINUX=permissive
To:
SELINUX=disabled
# reboot
7. Remove the Fedora Core 3 kernel(s) to prevent the
aforementioned kernel-utils
package dependency error.
# yum remove kernel-2.6.\*FC3\*
# yum remove kernel-smp\*FC3\* (if you have one or more FC3 SMP kernels installed)
8. Continue the upgrade to Fedora Core 4.
#
yum -y upgrade
Note: if you receive the following error, import the RPM-GPG-KEY.
warning: rpmts_HdrFromFdno: V3 DSA
signature: NOKEY, key ID db42a60e
public key not available for
caching-nameserver-7.3-3.noarch.rpm
# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY
9. Reboot the system to
begin using Fedora Core 4.
10. If applicable, re-enable SELinux by undoing the changes above, and
reboot the system to use SELinux.
User-contributed notes on Upgrading to Fedora Core 4
On 2005/07/16, Jay Thorne wrote:
Before you upgrade the kernel, you need to upgrade mkinitrd, otherwise
the initrd that the kernel install process makes is in the old format
and the new kernel will not boot; it dies with a oops.
# yum -y upgrade mkinitrd
Otherwise, this procedure works well. Good work.
Also, in the x86_64 case, you need to specifically upgrade
libselinux.i386 and libselinux.x86_64 before the kernel upgrade, or the
upgrade will fail with a conflict.
# yum -y upgrade libselinux.i386 libselinux.x86_64
Thanks for Wim Cos for writing on 2005/06/16 and providing the steps to update yum to the latest FC3 version and for the steps to remove FC3 SMP kernels, if applicable.
Upgrading to Fedora Core 3
Before proceeding, please read Seth
Vidal's post (Seth is the author of yum) to the fedora-test-list mailing list
regarding upgrading from FC2 to FC3 using yum.
1. Verify that the Fedora Project gpg key is installed.
$ rpm -q gpg-pubkey-6b8d79e6-3f49313d
gpg-pubkey-6b8d79e6-3f49313d
If this key is not installed, and you are running Fedora Core, you may
install it with:
# rpm --import
/usr/share/rhn/RPM-GPG-KEY-fedora
If this key is not installed, and you are not running Fedora Core, you
may install it with:
# rpm --import
http://fedora.redhat.com/about/security/4F2A6FD2.txt
2. Download the Fedora Core 3 version of fedora-release and yum from one of the Fedora Core
mirrors.
Example:
$ wget
http://fedora.glorb.com/core/3/i386/os/Fedora/RPMS/fedora-release-3-8.i386.rpm
$ wget
http://fedora.glorb.com/core/3/i386/os/Fedora/RPMS/yum-2.1.11-3.noarch.rpm
3. Install the Fedora Core 3 version of fedora-release and yum.
You may need to use the --force flag when installing the
RPMs as /etc/sysconfig/rhn/sources
from the Fedora Core 3 fedora-release
conflicts with up2date.
# rpm -Uvh fedora-release-3-8.i386.rpm
yum-2.1.11-3.noarch.rpm
Preparing...
########################################### [100%]
file /etc/sysconfig/rhn/sources from install of fedora-release-3-8
conflicts with file from package up2date-4.3.19-1
# rpm -Uvh --force
fedora-release-3-8.i386.rpm yum-2.1.11-3.noarch.rpm
4. Upgrade to Fedora Core 3.
# yum upgrade
After several minutes, yum
will present a large list of packages that will be upgraded, newly
installed, and obsoleted. Choose "y" to download and install the
packages.
Is this ok [y/N]: y
Possible problem:
When upgrading from Fedora Core 2 to Fedora Core 3 on one of my
systems, yum upgrade
experienced dependency problems with many packages, likely due to this
bug in rpm. rpm 4.3.1-0.3 was installed when
this problem occurred.
Example:
Error: Requiring package
gnome-vfs2-2.8.2-8.i386 not in transaction
set nor in rpmdb
Installing the Fedora Core 3 versions of rpm
(4.3.2-21) and its dependencies (rpm-python,
rpm-build, rpm-devel) and re-running yum upgrade fixed the problem.
5. Reboot the system to begin using Fedora Core 3.
Note: you may want to modify /boot/grub/grub.conf
and choose the new 2.6.9 kernel (uniprocessor or SMP) as the
default kernel as yum upgrade
will not modify the default kernel chosen by the grub bootloader. Remember that grub counts the first listed kernel
as number 0.
/boot/grub/grub.conf after yum upgrade:
default=2
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/
initrd /initrd-2.6.9-1.667.img
title Fedora Core (2.6.9-1.667smp)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667smp ro root=LABEL=/
initrd /initrd-2.6.9-1.667smp.img
title Fedora
Core (2.6.6-1.435.2.3smp)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435.2.3smp ro root=LABEL=/
initrd /initrd-2.6.6-1.435.2.3smp.img
title Fedora Core
(2.6.6-1.435.2.3)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/
initrd /initrd-2.6.6-1.435.2.3.img
/boot/grub/grub.conf after
manual modification:
default=1
timeout=10
splashimage=(hd0,0)/grub/splash.xpm.gz
title Fedora Core (2.6.9-1.667)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667 ro root=LABEL=/
initrd /initrd-2.6.9-1.667.img
title Fedora
Core (2.6.9-1.667smp)
root (hd0,0)
kernel /vmlinuz-2.6.9-1.667smp ro root=LABEL=/
initrd /initrd-2.6.9-1.667smp.img
title Fedora Core
(2.6.6-1.435.2.3smp)
root (hd0,0)
kernel /vmlinuz-2.6.6-1.435.2.3smp ro root=LABEL=/
initrd /initrd-2.6.6-1.435.2.3smp.img
title Fedora Core (2.6.6-1.435.2.3)
root (hd0,0)
kernel
/vmlinuz-2.6.6-1.435.2.3 ro root=LABEL=/
initrd
/initrd-2.6.6-1.435.2.3.img
Upgrading to Fedora Core 2
You may want to read the following notes from the yum author about upgrading from Fedora
Core 1 to Fedora Core 2:
http://linux.duke.edu/~skvidal/misc/fc1-fc2-yum-hints.txt
Here are the steps I used to upgrade a system from Fedora Core 1 to
Fedora Core 2:
1. Install the Fedora Core 2 version of yum and fedora-release:
# rpm -Uvh ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/yum-2.0.7-1.1.noarch.rpm
\ ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/2/i386/os/Fedora/RPMS/fedora-release-2-4.i386.rpm
2. If yum was already
installed prior to the upgrade, backup your old /etc/yum.conf file and replace /etc/yum.conf with /etc/yum.conf.rpmnew.
# mv /etc/yum.conf /etc/yum.conf.`date
+%m.%d.%y`
# mv /etc/yum.conf.rpmnew /etc/yum.conf
3. Edit /etc/yum.conf.
Choose a mirror from http://fedora.redhat.com/download/mirrors.html to the [base] and [updates-released] sections.
Original [base] and [updates-released] sections:
[base]
name=Fedora Core $releasever -
$basearch - Base
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
[updates-released]
name=Fedora Core $releasever -
$basearch - Released Updates
baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
New [base] and
[updates-released] sections:
[base]
name=Fedora Core $releasever -
$basearch - Base
baseurl=ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/$releasever/$basearch/os/
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/$releasever/$basearch/os/
[updates-released]
name=Fedora Core $releasever -
$basearch - Released Updates
baseurl=ftp://ftp.linux.ncsu.edu/pub/fedora/linux/core/updates/$releasever/$basearch/
#baseurl=http://download.fedora.redhat.com/pub/fedora/linux/core/updates/$releasever/$basearch/
4. Upgrade to Fedora Core 2.
# yum upgrade
Upgrading to Fedora Core 1
Here are the steps I used to upgrade a system to Fedora Core 1:
1. Download and install the Fedora version of yum:
# rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/1/i386/os/Fedora/RPMS/yum-2.0.4-2.noarch.rpm
2. Download and install the fedora-release
package.
# rpm -Uvh
http://download.fedora.redhat.com/pub/fedora/linux/core/1/i386/os/Fedora/RPMS/fedora-release-1-3.i386.rpm
3. Upgrade to Fedora Core 1.
# yum upgrade
Upgrading to Red Hat Linux 9
Here are the steps I used to upgrade a Red Hat Linux 8.0 system to Red
Hat Linux 9.
1. Download
and install the latest version of yum.
# rpm -Uvh http://linux.duke.edu/projects/yum/download/2.0/yum-2.0.4-1.noarch.rpm
2.
Download and install the redhat-release
package from the "new" version of Red Hat Linux.
# rpm -Uvh ftp://ftp.quicknet.nl/pub/Linux/ftp.redhat.com/9/en/os/i386/RedHat/RPMS/redhat-release-9-3.i386.rpm
3. If the gnome-mime-data
package is installed (confirm with rpm
-q gnome-mime-data), change exactarch=1
to exactarch=0 in /etc/yum.conf.
4. Upgrade to Red Hat Linux 9.
# yum upgrade
5. If applicable, change exactarch=0
back to exactarch=1 in /etc/yum.conf.
The following are some problems I ran into with the upgrade from Red
Hat Linux 8.0 to Red Hat Linux 9.
Problem:
Resolving dependencies
.package apt needs librpm-4.1.so
(not provided)
package apt needs librpmdb-4.1.so
(not provided)
package apt needs librpmio-4.1.so
(not provided)
package apt needs libelf.so.0
(not provided)
Solution: # rpm -e apt (I will
use yum instead of apt for rpm for package management;
I could always manually reinstall apt
for rpm after the upgrade)
Problem:
Resolving dependencies
.......identical dependency loop
exceeded
package gnome-vfs2 needs
gnome-mime-data >= 2.0.0-11 (not provided)
Solution: Set exactarch=0
in /etc/yum.conf. The Red Hat
Linux 9 gnome-mime-data
package is of a different architecture (i386) than the Red Hat Linux
8.0 package (noarch). You may want to change back to exactarch=1 after the yum upgrade.
Problem: After rebooting into the new kernel, my eth0 network interface
was brought up with a static address and then with dhcp. During the
upgrade process, the file /etc/sysconfig/network-scripts/ifcfg-eth0.dhcp
was created. You may want to check /etc/sysconfig/network-scripts
for any changes prior to rebooting after the upgrade.
Back to brandonhutchinson.com.
Last modified: 2006/03/21