Linux Vids project is an effort to collect videos that help people learn the Linux operating system, comparision with Microsoft Windows, Tips and Tricks, Hacks, Softwares, Technology and all the stuff related to the Open Source World. The goal of the Linux Vids project is to help you can learn Linux easily and stay tuned.


linux-videos-learn-open-source-gnu-hacking-softwares-windows-vista-xp-winxp
linux-videos-learn-open-source-gnu-hacking-softwares-windows-vista-xp-winxp
linux-videos-learn-open-source-gnu-hacking-softwares-windows-vista-xp-winxp

How to create a local yum repository in CentOS

Create a CentOS mirror for your local network

First create the directories (you have to replace the 4 and i386 to match your major version and architecture):

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

then,
mkdir -pv /var/www/html/centos/5/os/i386/CentOS/RPMS/
and copy the CD/DVD rpms here.

Creating the base repository headers:
createrepo /var/www/html/centos/5/os/i386/

If you don't have createrepo installed, you can download and install it by typing: yum install createrepo

Updating the repository:
First, select an rsync mirror for the updates from CentOS Mirror List

For example: rsync://mi.mirror.garr.it/CentOS/

Then create the updates-released repo by running rsync:
rsync -avrt rsync://mi.mirror.garr.it/CentOS/5.3/updates/i386 --exclude=debug/ /var/www/html/centos/5/updates/

The update repository will be created in /var/www/html/centos/5/updates

Yum configuration:
Simply edit /etc/yum.repos.d/CentOS-Base.repo and replace your current configuration with this one below:

[base]
name=CentOS-$releasever - Base
baseurl=http://192.168.*.*/centos/$releasever/os/$basearch/
#mirrorlist=http://192.168.*.*/centos/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-$releasever - Updates
baseurl=http://192.168.*.*/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

I hope it was helpful !

No comments: