Thursday, December 13, 2012

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