Proper Recipe For Local Mirror

Home » CentOS » Proper Recipe For Local Mirror
CentOS 4 Comments

Hi! What is the proper solution for a local mirror for CentOS 7 (or oven
8) repositories?

trying with rsync, while the packages are downloaded but the repodata is not and is actually impossible to be used by clients. while i try to recreate the repodata with createrepo -C -d –workers=4 ${repo}
where ${repo} is the sync destination where it contains
%arch/{Packages,repodata} directories

the clients throw errors like:
/mirrors/CentOS/7/updates/x86_64/repodata/51d63b04c8bb74c5d9f09ae65f763f319a69492d9a8fac5ea0bf9b63bf347c5c-primary.sqlite.bz2:
[Errno 14] HTTP Error 404 – Not Found

What am i missing?
Thanks a lot!
Adrian

4 thoughts on - Proper Recipe For Local Mirror

  • and for CentOS 7?
    as i can see the problem is with that repodata which is no longer a problem on 8…

    Thanks!!
    Adrian

  • Hi,

    The script below is how I sync CentOS to a local mirror which is then used directly by the clients, no createrepo needed.

    Please note that the exclude list is something to adjust to your needs to save space and traffic. Also the $MIRRORS list should be changed to use best mirrors for your situation.

    Hope this helps, Simon

    —%<-

  • Hi!

    well, thanks a lot!! due to your script i noticed that the mirror that i used does not sync the sqlite and xml files from repodata (only repomd.xml and repomd.xml.asc)

    i changed the mirror and everything worked flawless :)

    Thanks a lot!
    Adrian