Create a local EPEL mirror

We use some add-on packages from EPEL. Since we want to peg packages to specific versions only, and to reduce the number of servers that connect directly to the internet, we decided to build a local mirror for the EPEL repository.

  1. Install dependencies.

  2. Patch reposync to add option for "flattened" directories. (By default, reposync creates a directory named after the repo ID for placing the downloaded packages.)

  3. Create the repository directories.

  4. Start downloading the repo.

  5. Copy the packages to staging first.

  6. Create repo metadata.

  7. Add the following configuration file to /etc/httpd/conf.d/.

    Restart Apache.

  8. Use the following yum repo config in /etc/yum.repos.d/.

To test:

sudo yum repolist

Comments

  1. Hi Ian,

    I have used this tutorial for a Red Hat 6.3 and work well.

    Have you create some script to keep updated yout epel repository?

    I'm trying use this:

    /usr/bin/reposync -a x86_64 -r epel -p /srv/mirror/epel.staging -n

    ReplyDelete
  2. Hi, Diego.

    Sorry for getting back to you just now. :-)

    I haven't written any update script. Yet. We try to "freeze" our repos at a certain point so updates are few -- except for major security errata. But creating one should be trivial. The steps would be similar to what you've done (reposync to staging, copy to "live" tree, createrepo live tree, yum update on client).

    Hope this helps. Thanks for dropping by.

    ReplyDelete

Post a Comment

Popular posts from this blog

Pull files off Android phone