[CentOS] Starting a Local CentOS Mirror

Fri Jun 27 12:42:22 UTC 2008
Johnny Hughes <johnny at centos.org>

Art Age Software wrote:
> Hi all,
> 
> I would like to set up a local CentOS mirror, as suggested by others
> on this list, to cut down on bandwidth usage, etc. I have read a
> couple HowTos and it seems pretty straight-forward, but I do have some
> questions.
> 
> 1) How should I change my entries in /etc/yum.repos.d? Specifically,
> should I replace CentOS-Base.repo with my own .repo file?
>

You probably need to edit your CentOS-Base.repo file.  See my suggested 
way in the answer to your next question.

> 2) Is there a way to configure yum to prefer the local repo, but use
> an external mirror if the local is not available?
> 

Yes

You can just add one baseurl=<local_path> line to your CentOS-Base.repo 
file for each section ([base], [updates], etc.) ... while still leaving 
the "mirrorlist=" one enabled.  Then install the yum-fastestmirror 
plugin ... fastest mirror SHOULD always pick your local mirror, and if 
it is not available it should pick the next fastest one listed.

> 3) What is the best practice around keeping the local repo updated? A
> once-a-day cron job to rsync from an external mirror? If this is the
> correct approach, is there a way to rsync from a "mirror list" so that
> updates won't fail if a particular mirror happens to be unavailable
> when the cron job runs?

We do not provide public syncs from our infrastructure except for 
"public mirrors" (people who are allowing public access to their 
mirrors) ... however, there are about 200 public mirrors, some of which 
provide rsync. Here is the list of public mirrors:

http://www.centos.org/modules/tinycontent/index.php?id=13

Thanks,
Johnny Hughes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
URL: <http://lists.centos.org/pipermail/centos/attachments/20080627/52fa26d9/attachment-0005.sig>