Mirroring CentOS.org

Home » CentOS » Mirroring CentOS.org
CentOS 4 Comments


I would like to mirror the CentOS.org repository for an offline network. I
don’t need the ISO images, don’t need any i386 stuff, and I think I
probably don’t need any of the source code rpms either. Most of the clients are CentOS 6.x, so I don’t want to download the CentOS 7.x tree yet either
(that will come soon, but separately from this one).

I tried using this command, but it still downloaded all of the i386
sub-folders anyway, and I got about 15 gigs or so of stuff I didn’t want.

wget -m -np –exclude-directories=i386 http://mirror.CentOS.org/CentOS-6/6/

I’m guessing there’s a formatting mistake of some kind in this command. Do you need to specify the excluded sub-folders relative to the top directory you’re downloading from? i.e. rather than “i386”, you’d need to specify


4 thoughts on - Mirroring CentOS.org

  • You probably should start by not mirroring mirror.CentOS.org, but a local mirror:


    If you plan on regularly mirroring the CentOS repos on that site, please contact them and let them know.

    You should also consider using a yum-aware tool like reposync, mrepo or pulp to create your own repos, rather than using ‘wget’. Many repos have rsync:// support, which means you can also use rsync to do this.

  • In article , Felipe Westfields wrote:

    Don’t use wget at all. Use rsync instead, from a mirror that supports it. Here is what I use (in a nightly cron):

    # cd /myrepo
    # rsync -rltHvz –delete rsync://rsync.mirrorservice.org/mirror.CentOS.org/6/os/i386/ CentOS6/os/i386/
    # rsync -rltHvz –delete rsync://rsync.mirrorservice.org/mirror.CentOS.org/6/updates/i386/ CentOS6/updates/i386/
    # rsync -rltHvz –delete rsync://rsync.mirrorservice.org/mirror.CentOS.org/6/os/x86_64/ CentOS6/os/x86_64/
    # rsync -rltHvz –delete rsync://rsync.mirrorservice.org/mirror.CentOS.org/6/updates/x86_64/ CentOS6/updates/x86_64/

    Omit the ones you don’t want.

    There are other ideas listed at https://wiki.CentOS.org/HowTos/CreateLocalMirror

    Cheers Tony

  • Ok, that sounds a little more elegant.

    Does that delete switch delete those files after download, or does it stop it from downloading at all?

  • It means “remove files that aren’t on the source”. This would generally be older versions of packages that have been replaced.