[CentOS] Configuring Local Repo

Stephen Harris lists at spuddy.org
Tue Feb 16 20:30:19 UTC 2010


On Tue, Feb 16, 2010 at 03:22:43PM -0500, Alberto Garcia Gomez wrote:
> I have a local repo of Centos, I'll like to used as part of my Internet Repos, 
> so I wonder how can I do that 

If you've rsync'd one of the standard mirrors then something like this...
create a file /etc/yum.repos.d/mycentos.repo which has lines such as

   [c5-local]
   name=CentOS-$releasever - Media
   baseurl=file:///RedHat/DVD/CentOS-5/
   gpgcheck=1
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
   protect=1
   priority=1
   enabled=1

   [update-local]
   name=CentOS-$releasever - Updates local
   baseurl=file:///RedHat/updates/centos$releasever/$basearch/
   gpgcheck=1
   gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
   protect=1
   priority=1
   enabled=1


This will create two new repo's for yum to use; one looking at the DVD
contents and one looking at the (rsync'd) updates folder.

In my case they're stored on an NFS server automounted at /RedHat.  If
you're doing this via a web server then just put in your http://
values.

If, instead, you're talking about creating your own package repository
then look into something like "mrepo" to create the repository metadata
and then create a yum.repos.d file to point to it.

-- 

rgds
Stephen



More information about the CentOS mailing list