Setting up local Redhat repository
Step 1: Get a web server up and running
Choose your favourite web server, setup an alias pointing to the repositories. For my example, the repository sits on a NFS share and it's served by lighttpd:## rhel6 repo alias.url = ( "/rhel6/" => "/nas/public/temp/rhel6/" )
Step 2: Create the directory structure
Base-pkg should contain the packages from your install media, updates should contain update packages.mkdir -p /nas/public/temp/rhel6/{base-pkg,updates}Step 3: Download the packages from Redhat
From a registered RHEL6 machine, run yumdownloadercd /nas/public/temp/rhel6/updates yumdownloader *
Step 4: Copy packages from install media
mount -oro,loop rhel-server-6.1-x86_64-dvd.iso t cp -ar /my/downloads/iso/t/Packages/* /nas/public/temp/rhel6/base-pkg/
Step 5: Install createrepo and run it
Get createrepo from yumyum -y install createrepo
Then run it
cd /nas/public/temp/rhel6/base-pkg/ createrepo /nas/public/temp/rhel6/base-pkg/ cd /nas/public/temp/rhel6/updates/ createrepo /nas/public/temp/rhel6/updates/
Step 6: Configure local repo on client machines
Create a local.repo under /etc/yum.repos.d/etc/yum.repos.d/local.repo
name=Redhat $releasever - $basearch
failovermethod=priority
baseurl=http://192.168.13.101/rhel6/base-pkg/
enabled=1
gpgcheck=0
[updates-local]
name=Redhat $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://192.168.13.101/rhel6/updates/
enabled=1
gpgcheck=0
failovermethod=priority
baseurl=http://192.168.13.101/rhel6/base-pkg/
enabled=1
gpgcheck=0
[updates-local]
name=Redhat $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://192.168.13.101/rhel6/updates/
enabled=1
gpgcheck=0
Step 7: Keep updates up-to-date
Suppose if there is a good way to tell yumdownloader to fetch only the updates, it should be scheduled regularly. Then run createrepo again to update the meta filescd /nas/public/temp/rhel6/updates/ createrepo --update
There are no comments on this page. [Add comment]