| |
 |
|
Owl River Company
|
|
|
|
Your IP is: 38.107.191.111
|
http://www.owlriver.com/tips/centos-31-ex-rhl-9/
Using yum to upgrade from Red Hat Linux 9 to CentOS 3.1
There have been several inquiries about moving away from Red
Hat Linux 9 to CentOS (the trademark elided, community rebuild
project of the publicly
released and freely restributable parts of Red Hat 'Enterprise Linux').
See: Owl River 'Wings'
product site and Centos.org
website; CentOS is in turn one of several sub-projects of the
'Caosity' Community based,
RPM packaged Linux distribution.
We have written generally about using 'yum' to effect transitions and
forward compatible upgrades from prior commercial and free distrubutions;
See: Using yum
to upgrade from Red Hat 8 to Red Hat 9 and Using
yum to upgrade from cAos-1 to CentOS-3. Please take a moment, and read
the first parts of each, and the strong emphasis on taking backups
before they are needed.
Once the backups are done, the process boils down to this:
- Update the subject system to the terminal updates of the prior
release, probably using yum, and remove any unneeded packages. Package
removal is beyond the scope of this document, but is done using the rpm -e
(packagename) approach.
Particularly watch for and remove unneeded or unused development packages.
This is needed to address the fact that a
RHEL derived base system will not have the rich range of '-devel'
packages which RHL 9 carried.
- Clear sufficient space in the filesystem, and get a local archive of the
CentOS RPMs in place. This may be done by retrieval of the ISO images from
a CentOS
mirror, and then progressively mounting each of the images in turn
on the loopback device and using:
cp /path/to/mount/RedHat/RPM/* /path/to/local/copy/
Again, lookback mounting and ISO usage are matters are beyond the scope of this
document, but are more fully discussed in our discussion about the tools for PXE installs, which
notes are also fully applicable for use with CentOS-31.
- Pull and also copy in the updates
from a CentOS mirror into that same
local copy point. [Strictly speaking, this addition of the updates
should not be immediately necessary, but
the original CentOS 3.1 ISOs had an improper dependency on three perl
modules, which is addressed in the updates, and fixed in later ISOs -- we
mention it to avoid an issue which also discussed
in the CentOS Build8 to final Release notes.]
- Build a yum archive for that local RPM set:
cd /path/to/local/copy/
yum-arch .
- Import the CentOS GPG rpm-signing key (local copy), which is found on the ISO
image, or at the mirror site, using, eg,:
rpm --import http://mirror.caosity.org/centos-3/RPM-GPG-KEY-CentOS-3
- Put together a minimal /etc/yum-upgrade.conf:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
tolerant=1
exactarch=1
[upgrade]
name=Centos upgrade
baseurl=file://localhost/path/to/local/copy/
# this may commented out when using the respin ISO
# or with the [update] stanza below
# [base]
# name=CentOS-$releasever - Base
# baseurl=http://mirror.centos.org/centos/3.1/os/$basearch/
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/3.1/updates/$basearch/
- Alternatively, for a 'wire' upgrade we could use:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
tolerant=1
exactarch=1
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/3.1/os/$basearch/
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/3.1/updates/$basearch/
- As a matter of safety, upgrade rpm, the kernel and their dependencies
first:
rpm -vv --rebuilddb
yum -y -t -c /etc/yum-upgrade.conf upgrade rpm kernel
rpm -vv --rebuilddb
yum -y -t -c /etc/yum-upgrade.conf upgrade rpm kernel
(yum, yum.conf and yum-arch each have excellent
and current man pages for the curious), and then inspect the bootloader
(hopefully grub at this time), and
reboot, just to let any library updates take effect.
- Then, let's do the rest:
yum -y -t -c /etc/yum-upgrade.conf upgrade
At this point, we should be all done with the mechanical part of the upgrade,
and ready to edit any configuration
files needing attention (usually flagged with a .rpmnew suffix
during the upgrade). Assuming the host was maintained
using packages only managed under RPM, all should work. It might make sense
to examine older packages, and remove any 'holdover' packages missed earlier
which are not being used:
rpm -qa --last
will show the oldest packages at the bottom of the listing.
We welcome reports of success (or failure, which we will attempt to
address by email), and ask that you please report any errors, unclarity, or
suggestions for improvement to: info+centos-ug@owlriver.com .
Please confirm that
you are viewing the most recent copy of this site, and mention the revision
date below.
Sample CentOS /etc/yum.conf
A typical production /etc/yum.conf, pointed at the mirror
system, would look like this:
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
installonlypkgs=kernel kernel-smp kernel-hugemem kernel-enterprise kernel-debug kernel-unsupported kernel-smp-unsupported kernel-hugemem-unsupported
tolerant=1
exactarch=1
[base]
name=CentOS-$releasever - Base
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
#packages in testing
#[testing]
#name=CentOS-$releasever - Testing
#baseurl=http://mirror.centos.org/centos/$releasever/testing/$basearch/
Acknowledgement
Thanks to our reviewers and testers, including my long-time tester: Chesley Windon
Back to Top Page
Last modified: Wed, 16 Jun 2004 13:33:11 -0400
http://www.owlriver.com/tips/centos-31-ex-rhl-9/index.php