Setting up yum and up2date on centos 4

I’m going to use this sunsite mirror repository for CentOS. You may want to use a closer one. If you’re not using an i386 machine then you’ll need to change the path accordingly.

I’ve already set myself up to use sudo. If you’ve not done this then you’ll need to be root for these steps to work.

Get rid of pre-existing packages

If you’ve previously installed as Red Hat Enterprise Linux or similar (White Box, for instance) then I’d advise you get rid of a few packages:

rpm --test --erase up2date up2date-gnome rhn_register rhn_register-gnome redhat-release-4ES-3

Installing yum

SITE=http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/4/os/i386/CentOS/RPMS/
rpm -i ${SITE}/yum-2.4.0-1.centos4.noarch.rpm
rpm -Uvh ${SITE}/centos-release-4-2.1.i386.rpm
rpm --import http://mirror.centos.org/centos-4/4.2/os/i386/RPM-GPG-KEY-centos4

You might find the version of yum has gone up a few version numbers, and this one isn’t available any more. In which case, use the latest. This might result in a few failed dependencies. In which case, get those packages too.

Configuring yum

Add the following lines (or something simlar) to the end of /etc/yum.conf. The addons, extras and dag sections are optional; but you might find them useful.

[base]
name=CentOS-$releasever - Base
baseurl=http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/$releasever/os/$basearch/
gpgcheck=1
 
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/$releasever/updates/$basearch/
gpgcheck=1
 
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
baseurl=http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/$releasever/addons/$basearch/
gpgcheck=1
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/$releasever/extras/$basearch/
gpgcheck=1 
 
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
#baseurl=http://apt.sw.be/redhat/el$releasever/en/$basearch/dag 
yum dag http://dag.linux.iastate.edu/dag/fedora/3/en/$ARCH/dag
baseurl=http://dag.linux.iastate.edu/dag/redhat/el$releasever/en/$basearch/dag
gpgcheck=1
enabled=1 
 

Configure RPM

rpm -i ${SITE}/centos-release-4-2.1.i386.rpm
rpm --import /usr/share/doc/centos-release-*/RPM-GPG-KEY-centos4
rpm --import /usr/share/doc/centos-release-*/RPM-GPG-KEY
rpm --import http://www.sunsite.org.uk/sites/msync.centos.org/CentOS/4/os/i386/RPM-GPG-KEY

Use yum

yum check-update

This will give you a list of things it wants to update. If you’re cool about this run

yum update

And it will update them all. You can also use the up2date tool; but there is little benefit. The only difference I can see is up2date will try and update packages where the software version is the same, but the build version is different, where as yum will only care if the software version is different.

 
technical/unix/linux/yum.txt · Last modified: 2006/01/20 18:32 by garylaw