Create CentOS 5.x Local Update Repository

Taking care of your Linux box.

Create CentOS 5.x Local Update Repository

Postby saifkhan123 » Wed Aug 19, 2009 12:11 pm

check out my blog for that

http://net-warrior.blogspot.com/
everything that seems to be true is not always true.
saifkhan123
Cadet
 
Posts: 7
Joined: Thu Apr 23, 2009 8:26 am

How to create Centos 5.x Local Repository

Postby saifkhan123 » Sat Aug 29, 2009 12:42 pm

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.
saifkhan123
Cadet
 
Posts: 7
Joined: Thu Apr 23, 2009 8:26 am


Return to “%s” Administration

Who is online

Users browsing this forum: No registered users and 0 guests

cron