How to create Linux Local Update Server(CentOS 5)

Share your expert knowledge and show off your skills.
Posts: 7
Joined: Thu Apr 23, 2009 8:26 am

How to create Linux Local Update Server(CentOS 5)

Postby saifkhan123 » Mon Aug 31, 2009 11:11 am

This How to will work for Centos 5.x

Required Packages:
Apache web server,rsync and createrepo packages must be installed in the server before starting the whole process,

Installation Method: (Server-Side Settings)

I have used CentOS 5.3 as the base operating system, this repository is workable for CentOS 5.x versions

Login to the console as root and type the following commands

Code: Select all

$ mkdir -p /var/www/html/centos/5/os/i386           

$ mkdir -p /var/www/html/centos/5/updates/i386

than copy the whole contents of Centos 5.3 DVD in i386 directory, the createrepo.rpm must be installed in the system, than type

Code: Select all

$ createrepo /var/www/html/centos/5/os/i386/
$ cp -r /var/www/html/centos/5/os/i386/* /var/www/html/centos/5/updates/i386

Now the rsync should be run in a daily cron as

Code: Select all

$ rsync -avrt rsync:// \ --exclude=debug/ /var/www/html/centos/5/updates

This will create a complete update repository at /var/www/html/centos/5/updates/i386. The repodata directory will be created with all of the headers. Next I would advise to setup a cron job to run the rsync (above). In this manner your repository keep updated and only new updates and headers will be downloaded to your repository.

Client-Side Settings:

On client side, rename the files present in /etc/yum.repos.d which are Centos-Base.repo and Centos-Media.repo
to *.old and create a new file named localCentos-Base.repo and copy the following in that

Code: Select all

# vi /etc/yum.repos.d/localCentOS-Base.repo

name=CentOS-$releasever - Base

name=CentOS-$releasever - Updates

name=CentOS-$releasever - Extras

everything that seems to be true is not always true.
everything that seems to be true is not always true.

Return to “Howto's & Tip n' Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest