Skip to content
Search Oracle Linux

    Browse this documentation

    Building an intranet mirror: full reposync sync and a mini-repo with createrepo_c (container measured)

    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.

    Terminal window
    dnf install -y dnf-plugins-core
    dnf reposync --repoid=ol10_addons --download-metadata -p /srv/mirror

    Measured (the addons repo):

    (204/204): resource-agents-...x86_64.rpm
    du -sh /tmp/mirror/ol10_addons # 845M
    ls /tmp/mirror/ol10_addons/
    # getPackage getPackageSource repodata

    Key points:

    • --download-metadata brings the metadata back too (downstream dnf consumes it directly, no rebuild needed);
    • --forcearch x86_64 mirrors x86_64 packages from an ARM machine (measured) — one machine, many architectures;
    • Capacity awareness: addons is 845M, BaseOS/AppStream are GB-scale — run df -h first;
    • Make it scheduled: cron/systemd timer running reposync, optionally with --delete to purge packages the upstream removed.
    /etc/yum.repos.d/ol10-internal.repo
    [ol10_baseos_latest-internal]
    name=OL10 BaseOS Internal
    baseurl=https://mirror.internal.example.com/ol10/baseos/latest/x86_64/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle

    Keep gpgcheck on (the mirror’s content integrity is still guaranteed by signatures — see the RPM verification page).

    Terminal window
    mkdir -p /srv/myrepo && cd /srv/myrepo
    dnf download --resolve bash # or drop your own rpms in
    createrepo_c . # generate repodata
    [myrepo]
    name=My Repo
    baseurl=https://mirror.internal.example.com/myrepo/
    enabled=1
    gpgcheck=0 # self-built packages can be self-signed and then gpgcheck enabled

    The 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.

    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.

    • 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.