How to create Linux Local Update Server(CentOS 5)

Share your expert knowledge and show off your skills.

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://centos.arcticnetwork.ca/centos/5/updates/i386 \ --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

[base]
name=CentOS-$releasever - Base
baseurl=http://ReposerverIP/centos/$releasever/os/$basearch/
gpgcheck=0

[update]
name=CentOS-$releasever - Updates
baseurl=http://ReposerverIP/centos/$releasever/updates/$basearch/
gpgcheck=0

[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://ReposerverIP//centos/$releasever/updates/$basearch/
gpgcheck=0
enabled=0

_________________
everything that seems to be true is not always true.
everything that seems to be true is not always true.
saifkhan123
Cadet
 
Posts: 7
Joined: Thu Apr 23, 2009 8:26 am

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

Who is online

Users browsing this forum: No registered users and 1 guest

cron