[Yum] Major version upgrade via YUM??

Garrick Staples garrick at usc.edu
Fri Sep 12 15:24:56 UTC 2008


On Fri, Sep 12, 2008 at 10:55:24AM -0400, Seth Vidal alleged:
> On Fri, 2008-09-12 at 10:47 -0400, Sciandra, Joel wrote:
> > Are there issues doing a major version upgrade such as Centos 4.6 to
> > Centos 5.2 via YUM?
> > 
> 
> I think you'll find the kernel swap-around is tricky from 4->5 b/c of
> all sorts of dep changes.
> 
> Big jumps like that are frequently dodgy but do-able provided you reduce
> the set of pkgs on the machine to as small a set as possible.
> 
> My general suggestion if you want to try it would be:
>  1. to do a full backup
>  2. attempt the update
>  3. if it fails then punt and reinstall up to 5.2

Here's my quick and dirty script that I've been using.  It really is an ugly
thing to do to a machine.

The rpm URLs need to be updated.


#!/bin/bash

set -e
set -x

rpm -Uvh http://mirrors.usc.edu/pub/linux/distributions/centos/5.1/os/x86_64/CentOS/centos-release-5-1.0.el5.centos.1.x86_64.rpm http://mirrors.usc.edu/pub/linux/distributions/centos/5.1/os/x86_64/CentOS/centos-release-notes-5.1.0-2.x86_64.rpm

rpm -e MySQL-python
rpm -e e2fsprogs.i386 --justdb --nodeps
rpm -e elfutils.i386 --justdb --nodeps
rpm -e --justdb --nodeps python-elementtree

sed -i 's/centos4/CentOS-5/' /etc/yum.repos.d/CentOS-Base.repo

yum -y update

rpm -e python-sqlite --allmatches --nodeps
rpm -Uvh http://mirrors.usc.edu/pub/linux/distributions/centos/5/os/x86_64/CentOS/python-sqlite-1.1.7-1.2.1.x86_64.rpm

yum -y update
yum clean all

echo Fixing /etc/sysconfig/autofs
(
 . /etc/sysconfig/autofs
   echo -n OPTIONS=\"
   for a in $LOCALOPTIONS;do
     case "$a" in
        -*) echo -n $a\ ;;
        *) echo -n -O $a\ ;;
     esac
   done
   echo -n -Dro=\"\"\ 
   echo \"
) >> /etc/sysconfig/autofs


-- 
Garrick Staples, GNU/Linux HPCC SysAdmin
University of Southern California

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum/attachments/20080912/dcffe031/attachment-0001.pgp 


More information about the Yum mailing list