Building an intranet mirror: full reposync sync and a mini-repo with createrepo_c (container measured)
What you will learn
Section titled “What you will learn”Two forms of an intranet mirror: the full mirror (reposync, replacing upstream for company-wide use) and the mini-repo (createrepo_c, distributing your own RPMs). Measured and closed in containers.
The full mirror: reposync
Section titled “The full mirror: reposync”dnf install -y dnf-plugins-corednf reposync --repoid=ol10_addons --download-metadata -p /srv/mirrorMeasured (the addons repo):
(204/204): resource-agents-...x86_64.rpmdu -sh /tmp/mirror/ol10_addons # 845Mls /tmp/mirror/ol10_addons/# getPackage getPackageSource repodataKey points:
--download-metadatabrings the metadata back too (downstream dnf consumes it directly, no rebuild needed);--forcearch x86_64mirrors x86_64 packages from an ARM machine (measured) — one machine, many architectures;- Capacity awareness: addons is 845M, BaseOS/AppStream are GB-scale — run
df -hfirst; - Make it scheduled: cron/systemd timer running reposync, optionally with
--deleteto purge packages the upstream removed.
Consumers pointing at the mirror
Section titled “Consumers pointing at the mirror”[ol10_baseos_latest-internal]name=OL10 BaseOS Internalbaseurl=https://mirror.internal.example.com/ol10/baseos/latest/x86_64/enabled=1gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracleKeep gpgcheck on (the mirror’s content integrity is still guaranteed by signatures — see the RPM verification page).
The mini-repo: distributing your own RPMs
Section titled “The mini-repo: distributing your own RPMs”mkdir -p /srv/myrepo && cd /srv/myrepodnf download --resolve bash # or drop your own rpms increaterepo_c . # generate repodata[myrepo]name=My Repobaseurl=https://mirror.internal.example.com/myrepo/enabled=1gpgcheck=0 # self-built packages can be self-signed and then gpgcheck enabledThe measured chain (container): dnf download --resolve bash (with dependencies) → createrepo_c (Pool finished) → a local .repo referencing file:/// working. Signing your own packages and enabling gpgcheck=1 is steadier.
Working with security updates
Section titled “Working with security updates”The mirror must preserve the updateinfo metadata (reposync —download-metadata includes it), or downstream dnf update --security stops working (see the dnf security policy page). Periodically verifying the mirror’s advisory consistency with upstream is routine mirror operations.
Evidence and limits on this page
Section titled “Evidence and limits on this page”- Measured: the full sync (including cross-architecture), the mini-repo build, and local consumption (E2, aarch64 container);
- Not measured: disk/bandwidth planning for the large BaseOS/AppStream repos (magnitude estimates given) and multi-machine distribution architectures;
- Sources:
reposync(1),createrepo_c(8), yum.oracle.com.