Skip to main content

Fedora EPEL 7 mirror pinning

This guide aims to help in pinning down the repository location to a known FQDN, so it can be set in the allowlists, without affecting the performance of downloads.

Virtual Machine

AWS User Data / GCP Startup Script

#!/bin/bash -ex
sed --in-place=.orig --regexp-extended 's%#baseurl=http://(download.example|' /etc/yum.repos.d/epel*.repo
sed --in-place --regexp-extended 's%^metalink=%#metalink=%g' /etc/yum.repos.d/epel*.repo

The commands simply replace Fedora's default mirror redirector with a known, reliable CDN, making a backup file (with extension .orig) in the process.



FROM centos:7

RUN yum install --assumeyes epel-release && \
sed --in-place=.orig --regexp-extended 's%#baseurl=http://(download.example|' /etc/yum.repos.d/epel*.repo && \
sed --in-place --regexp-extended 's%^metalink=%#metalink=%g' /etc/yum.repos.d/epel*.repo && \
yum clean expire-cache



DiscrimiNAT Annotation

Alternative Mirrors

Although is a CDN with geo-located caches, you may want to pick a specific https mirror from Fedora's official mirrors list.