Skip to content
Search Fedora

    Browse this documentation

    Fedora repositories and dnf5

    Fedora’s repository model is not complicated, but the boundary between official and third-party repositories has to be drawn first: the official docs treat third-party software as its own section with its own enablement steps. Mix them and, when something breaks, you cannot even say who maintains the package.

    Default repositories: fedora / updates / updates-testing / rawhide

    Section titled “Default repositories: fedora / updates / updates-testing / rawhide”

    The official docs describe official repositories and third-party software separately: RPM Fusion, Flathub, Snap, AppImage and source installs each get their own subsection under Third Party Software, with their own steps.

    A normal Fedora install splits repositories by purpose. The official repository page describes each one, and the corresponding .repo files are:

    Repository.repo filePurpose
    fedorafedora.repostable content as shipped with the release
    updatesfedora-updates.repothe update stream for stable releases; enabled by default and normally kept enabled
    updates-testingfedora-updates-testing.repostaging for updates before they go stable (update candidates)
    rawhidefedora-rawhide.repothe only repository on Rawhide: enable it on Rawhide systems, never on others

    The repository names and .repo file names come from the official Fedora DNF repositories page (docs.fedoraproject.org); contents change over time, so check the official page before quoting this long-term.

    Since F45: repository configuration lives in two places

    Section titled “Since F45: repository configuration lives in two places”

    Fedora 45 moves the distribution’s own repository configuration from /etc/yum.repos.d to /usr/share/dnf5/repos.d, and the repository GPG keys from /etc/pki/rpm-gpg to /usr/share/pki/rpm-gpg (official change proposal RelocateRpmRepoConfigsToUsr).

    Terminal window
    # Turn off a packaged repository with an override; do not edit package-owned files under /usr
    sudo dnf config-manager setopt updates-testing.enabled=0

    Three boundaries to remember:

    • Packaged repositories (fedora / updates / updates-testing / rawhide): under /usr/share/dnf5/repos.d/, owned by the fedora-repos package, overwritten on upgrade — do not edit them by hand;
    • Custom and third-party repositories: still under /etc/yum.repos.d/, and config-manager addrepo drops the .repo from a release package there too;
    • Toggling packaged repositories: setopt writes to /etc/dnf/repos.override.d/99-config_manager.repo (generated by libdnf5, marked as not to be edited by hand).

    Adding, enabling and removing repositories

    Section titled “Adding, enabling and removing repositories”

    The official Quick Docs page Adding or removing software repositories in Fedora documents dnf config-manager’s addrepo / setopt usage, and the practice of deleting .repo files under /etc/yum.repos.d. Three kinds of actions map to three kinds of commands:

    Terminal window
    # Add: stage the .repo file somewhere temporary, then hand it to config-manager
    sudo dnf config-manager addrepo --from-repofile=/tmp/example.repo
    # Enable / disable: change enabled by repository ID
    sudo dnf config-manager setopt example.enabled=1
    sudo dnf config-manager setopt example.enabled=0
    # Remove: find out which file owns the repository ID first, then delete the file
    grep -E "^\[.*]" /etc/yum.repos.d/*
    sudo rm /etc/yum.repos.d/example.repo

    Since F45: the rm above only applies to custom repositories under /etc/yum.repos.d/. Packaged repositories live under /usr/share/dnf5/repos.d/; deleting those files neither works nor survives an upgrade — turn them off with setopt.

    Third-party sources: installing RPM Fusion

    Section titled “Third-party sources: installing RPM Fusion”

    RPM Fusion’s own configuration page gives the enablement commands: build the free and nonfree release package names with rpm -E %fedora, then install them with dnf install.

    Terminal window
    sudo dnf install \
    https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
    https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

    RPM Fusion is only one entry in the official Third Party Software section; the same section also covers Flathub, the Snap Store, AppImage and source installs — each with its own steps, so do not generalise from “install a release package” to every source.

    RPM Fusion’s configuration page also shows a typical syntax difference: enabling the fedora-cisco-openh264 repository is sudo dnf config-manager setopt fedora-cisco-openh264.enabled=1 on Fedora 41 and later, and sudo dnf config-manager --enable fedora-cisco-openh264 on Fedora 40 and earlier. Same action, two dnf generations; for the full difference and migration path see Moving from dnf to dnf5.

    The addrepo --from-repofile= and setopt <repo>.enabled=1|0 above are the dnf5 syntax, and the official Quick Docs repository page already gives examples in the new form. Scripts that still use old switches such as --enable / --disable have to be rewritten for repository management; a blanket sed replacement is not enough, because the parameter shape changed from “on/off switch” to “key-value setting”.

    Official repository packages come from the official mirror network rather than a hard-coded site. The official repository page gives a query form like https://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f44&arch=x86_64 — swap in your repo and architecture to check whether mirrors are available:

    MirrorRepository root
    Official mirror list (metalink)https://mirrors.fedoraproject.org
    Fedora primaryhttps://dl.fedoraproject.org/pub/fedora/linux
    Official downloadhttps://download.fedoraproject.org/pub/fedora/linux

    The addresses in the table come from the fedora profile in src/data/distro-profiles.json (registered with evidence per entry); the mirror network changes, so check the official page before quoting this long-term.