13.1.11

RHEL Yum Repository

Its been a year since I visited my blog, this was very helpful to me before on my running update server, sharing the idea..enjoy

1. Create the Directories:

mkdir -pv /var/www/html/yum/{base,updates}

2. Copy the RPMs from the CDs/DVD to /var/www/html/yum/base

3. Create the base repository headers:

"createrepo /var/www/html/yum/base"
This might take some time, depending upon the speed of your processor(s) and HD. On successful conclusion, createrepo should create a directory /repodata. The contents should be:
        filelists.xml.gz, other.xml.gz, primary.xml.gz, repomd.xml

4. Select a rsync mirror for updates:

A list is at http://fedora.redhat.com/download/mirrors.html and these are identified with “rsync.” For example: "rsync://distro.ibiblio.org/fedora-linux-core/". The mirrors share a common structure for updates. Simply append /updates//. Using FC4, this becomes:

5. Rsync to create the updates-released repository:

"rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/4/i386 \
--exclude=debug/ /var/www/html/yum/updates"

This will create a complete update repository at /var/www/html/yum/updates/i386. The repodata directory will be created with all of the headers.

At this point you can create a cron job for the rsync command, above. Only new updates and headers will be downloaded to your repository.
6. Edit /etc/yum.conf:

[updates-released]
name=Fedora Core $releasever - $basearch - Released Updates
#mirrorlist=http://fedora.redhat.com/download/mirrors/updates-released-fc$releasever
baseurl=http://192.168.0.xx/yum/updates/$basearch/
enabled=1
gpgcheck=1

[base]
name=Fedora Core $releasever - $basearch - Base
baseurl=http://192.168.0.xx/yum/Fedora/core/$releasever/base/RPMS
#mirrorlist=http://fedora.redhat.com/download/mirrors/fedora-core-$releasever
enabled=1
gpgcheck=1

On the machine with the repository, substitute localhost for the IP address.

0 comments: