Skip to content
Search Fedora

    Browse this documentation

    Domestic mirrors for Fedora: dnf, pip, npm, Maven, Cargo, containers and Flatpak

    The first thing to fix on a Fedora install in mainland China is the mirror. But F45 changed something that invalidates every older guide: the repository configuration files moved. That comes first, then the copy-paste setup.

    The mirror surface: dnf/EPEL, pip/npm, Cargo/Maven, container registries, Remi, Flathub and model downloads

    Terminal window
    ls /usr/share/dnf5/repos.d/
    fedora.repo fedora-cisco-openh264.repo fedora-updates.repo ...

    Up to F44 they were in /etc/yum.repos.d/; F45 moved them to /usr/share/dnf5/repos.d/ (see repository configuration moves to /usr).

    So:

    What you wantWhere to edit
    change an official repository URL/usr/share/dnf5/repos.d/*.repo (overwritten on upgrade)
    add your own repository/etc/yum.repos.d/*.repo (higher priority, never overwritten)

    Prefer the second: create a file in /etc/yum.repos.d/ and disable the original with enabled=0.

    Fedora 45 is not released yet, so mirrors disagree. Measured 2026-10-28:

    Sitereleases/45/releases/test/45_Beta/
    Aliyun404200
    Tsinghua TUNA404404
    USTC404404

    Only Aliyun carries the F45 Beta repository right now. After GA, releases/45/ appears everywhere and you switch the path.

    Configuration:

    Terminal window
    sudo tee /etc/yum.repos.d/99-lab-cn.repo >/dev/null <<'EOF'
    [lab-cn-base]
    name=Aliyun Fedora 45 Beta (base)
    baseurl=https://mirrors.aliyun.com/fedora/releases/test/45_Beta/Everything/x86_64/os/
    enabled=1
    gpgcheck=0
    skip_if_unavailable=True
    EOF

    Disable the original metalink repositories (they cannot find fedora-45 and will error out):

    Terminal window
    sudo dnf config-manager setopt fedora.enabled=0 updates.enabled=0
    sudo dnf makecache

    Verify:

    Terminal window
    dnf list --available nodejs | tail -2
    nodejs.x86_64 1:22.23.1-4.fc45 lab-cn-base

    Measured on F45: the Aliyun repo file under /etc/yum.repos.d, a successful makecache, and dnf list showing nodejs coming from lab-cn-base

    Third-party repositories: who supports f45

    Section titled “Third-party repositories: who supports f45”
    Repositoryf45 statusNote
    Remisupported (base repo only)https://mirrors.aliyun.com/remi/fedora/45/remi/x86_64/ works, but there is no remi-php83/84 versioned repository under f45 — it ships extensions and updates only
    RPM Fusionnot yetreleases/45/ returns 404, 44 works. NVIDIA drivers and multimedia codecs have to wait

    Remi configuration:

    Terminal window
    sudo tee /etc/yum.repos.d/remi-cn.repo >/dev/null <<'EOF'
    [remi-cn]
    name=Remi's RPM repository (Aliyun)
    baseurl=https://mirrors.aliyun.com/remi/fedora/45/remi/x86_64/
    enabled=0
    gpgcheck=0
    EOF
    sudo dnf --enablerepo=remi-cn makecache

    enabled=0 is deliberate: Remi replaces a large number of system packages, so enable it per-command with --enablerepo=remi-cn.

    Terminal window
    mkdir -p ~/.config/pip
    cat > ~/.config/pip/pip.conf <<'EOF'
    [global]
    index-url = https://pypi.tuna.tsinghua.edu.cn/simple
    trusted-host = pypi.tuna.tsinghua.edu.cn
    EOF

    Note that this is not always faster; see the measurements below.

    Terminal window
    npm config set registry https://registry.npmmirror.com
    npm config get registry
    https://registry.npmmirror.com

    Revert with npm config set registry https://registry.npmjs.org.

    Terminal window
    mkdir -p ~/.m2
    cat > ~/.m2/settings.xml <<'EOF'
    <settings>
    <mirrors>
    <mirror>
    <id>aliyun</id>
    <name>Aliyun Maven</name>
    <url>https://maven.aliyun.com/repository/public</url>
    <mirrorOf>central</mirrorOf>
    </mirror>
    </mirrors>
    </settings>

    Gradle takes an init script instead:

    Terminal window
    mkdir -p ~/.gradle
    cat > ~/.gradle/init.gradle <<'EOF'
    allprojects {
    repositories {
    maven { url 'https://maven.aliyun.com/repository/public' }
    }
    }
    EOF
    Terminal window
    cat > ~/.cargo/config.toml <<'EOF'
    [source.crates-io]
    replace-with = 'tuna'
    [source.tuna]
    registry = "sparse+https://mirrors.tuna.tsinghua.edu.cn/crates.io-index/"
    EOF

    rustup has its own switch:

    Terminal window
    export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
    export RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup

    Podman pulls from Docker Hub by default, which frequently times out here. Drop a file into /etc/containers/registries.conf.d/:

    Terminal window
    sudo tee /etc/containers/registries.conf.d/99-cn.conf >/dev/null <<'EOF'
    unqualified-search-registries = ["docker.io"]
    [[registry]]
    prefix = "docker.io"
    location = "docker.m.daocloud.io"
    EOF

    After that, podman pull nginx goes through the mirror automatically.

    Terminal window
    go env -w GOPROXY=https://goproxy.cn,direct
    go env GOPROXY
    Terminal window
    flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    flatpak remote-ls --app flathub | head -5

    Some university mirrors (USTC, SJTU) carry a /flathub tree, but the internal layout differs from the official one. Verify with flatpak remote-ls before switching, or you end up with a remote that lists nothing.

    Measurements: what switching actually buys

    Section titled “Measurements: what switching actually buys”

    Same machine (F45, gigabit LAN), measured 2026-10-28:

    OperationOfficialDomesticOutcome
    dnf install firewalld (11 packages)could not complete (DNS/metalink failure)Aliyun at 4.0 MiB/s, succeededthe mirror fixed availability, not just speed
    npm view express version1817 msnpmmirror 439 ms4x faster
    pip download numpy (16 MB)PyPI 2300 msTsinghua 3652 msofficial was faster
    #!/bin/bash
    # Fedora domestic mirrors; comment out what you do not need
    set -e
    # 1) dnf: official -> Aliyun (swap 45_Beta for 45 after GA)
    sudo tee /etc/yum.repos.d/99-cn.repo >/dev/null <<'EOF'
    [cn-base]
    name=Aliyun Fedora
    baseurl=https://mirrors.aliyun.com/fedora/releases/test/45_Beta/Everything/x86_64/os/
    enabled=1
    gpgcheck=0
    skip_if_unavailable=True
    EOF
    sudo dnf config-manager setopt fedora.enabled=0 updates.enabled=0
    # 2) npm
    npm config set registry https://registry.npmmirror.com
    # 3) pip
    mkdir -p ~/.config/pip
    printf '[global]\nindex-url = https://pypi.tuna.tsinghua.edu.cn/simple\n' > ~/.config/pip/pip.conf
    # 4) go
    command -v go >/dev/null && go env -w GOPROXY=https://goproxy.cn,direct
    # 5) containers
    sudo mkdir -p /etc/containers/registries.conf.d
    printf 'unqualified-search-registries = ["docker.io"]\n\n[[registry]]\nprefix = "docker.io"\nlocation = "docker.m.daocloud.io"\n' \
    | sudo tee /etc/containers/registries.conf.d/99-cn.conf >/dev/null
    echo "done"
    SymptomCause
    edits to /etc/yum.repos.d/ seem ignoredF45 keeps official repos in /usr/share/dnf5/repos.d/; /etc wins on identical repo id, but editing only the /usr copy gets overwritten on upgrade
    Failed to download metadata for repo 'updates'metalink cannot find fedora-45; disable the original repository first
    signature warnings after installthe cost of gpgcheck=0; restore it after GA
    pip got slower after switchingyour link is already good and the mirror adds a hop; measure with the curl above
    podman pull still times outonly unqualified-search-registries was set without the [[registry]] rewrite, or podman system reset is needed