logos

With Andrii Grytsenko


Technical Diary - With Andrii Grytsenko

Local Cent-OS repository step-by-step

There is some instruction how to make centralized repository for CentOS software.

As repository I have used my own Debian machine. Firstly, I have installed createrepo. This program generate some metadata which is necessary for RPM repository. Run

apt-get install createrepo

to install it from yum repository. Create two directories in the DocumentRoot environment. In my case its /var/www/html/ :

mkdir -pv /var/www/html/centos/5/{os,updates}/i386

Now copy packages from your CD/DVD installation disk to ./centos/5/os/i386 directory.
As I have an image file I should mount it first:

mount -o loop ~/CentOS-5.3-i386-bin-DVD.iso /mnt/dvd/

Only after you may start to copy:

cp /mnt/dvd/CentOS/* /var/www/html/centos/5/os/i386/

Its can take a while.
Also you need to get updates for your repository:

rsync -avrt rsync://mirror.web-ster.com/centos/5/updates/i386  --exclude=debug/

Take a look about more suitable rsync mirror for you here. It’s good idea to keep this directory updated all the time via cron.

Generate metadata for both directories.

cd /var/www/html/centos/5/os/i386/ && createrepo . 
cd /var/www/html/centos/5/updates/i386/ && createrepo . 

For server side is done. Please pay attention that your web-server should be run to keep the repository available.

Client side:

Backup your *.repo files in your /etc/yum.repos.d:

for i in *.repo; do mv $i $i.bak; done

And new one CentOS-Base.repo config with next context:

[base]
name=CentOS-$releasever - Base
baseurl=http://{IP address of your server}/centos/$releasever/os/$basearch/
gpgcheck=0
[update]
name=CentOS-$releasever - Updates
baseurl=http://{IP address of your server}/centos/$releasever/updates/$basearch/
gpgcheck=0

This steps should be repeated for each client machine.

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories

Translate

Map IP Address

Map IP Address