quick-docs/modules/ROOT/pages/dnf-repository-mirror.adoc
Rowan Puttergill 6aa69121ca Software-Management (#969)
This PR significantly overhauls the "Adding and managing software" section of Fedora Quick Docs,  bringing it up to date for currently supported releases (Fedora 41 and newer, using DNF5) and restructuring the navigation for clarity.

  *Navigation restructure*

The section is reorganised into three clear areas: core package management topics, a third-party software subsection, and a new "Installing popular applications" group. Topics covering specific applications (VLC, Spotify, Zoom, Chromium, Java, fonts, desktop environments) are grouped separately from package management mechanics. openh264.adoc is retired and its content is merged into  the multimedia plugins page.  Also, I separated out legal content and put that under the FAQ section and did away with the remaining content in packagekit-not-found.adoc because this was consolidated into some newer topics described below.

 *New topics*

I added several new topics:

  - Third-party software: overview of the distinction between Fedora release software and third-party sources, why software may be absent (patents, licensing, unpackaged), and safe usage practices
  - Flatpak / Flathub: installing and managing Flatpak applications, covering both GNOME Software and KDE Discover
  - Snap Store: installing and managing Snap applications
  - AppImage: running portable AppImage applications
  - Language package managers: pip, npm, Cargo, gem, and go install, with emphasis on isolation (virtual environments) and the preference for Fedora-packaged versions
  - ~~Managing software on immutable Fedora editions: rpm-ostree layering, Flatpak as the preferred app  delivery method, and Toolbox for development environments~~
  - Creating a DNF repository mirror: using dnf reposync to set up a local mirror, serving it with Apache, configuring clients, and keeping it current with a systemd timer
  - Fedora and software patents: split out from the retired packagekit-not-found.adoc into its own FAQ topic

 *Updated topics*

  - autoupdates.adoc: restructured (decision first, setup second), dnf-automatic.timer updated for DNF5 (single timer replaces the old per-mode timers), machine → system throughout, auter section retained and updated
  - package-management.adoc: rewritten to be a concise intro rather than a stub with broken links
  - securing-the-system-by-keeping-it-up-to-date.adoc: recommends dnf offline-upgrade over updating a  live system; redundant automatic updates section replaced with an xref to autoupdates.adoc
  - installing-java.adoc: Java version updated (LTS: 21, 25; latest: 26); JDK components list pruned of tools removed in JDK 9–14; modern tools added (jshell, jlink, jpackage, jdeps, jhsdb); dead links fixed (Freenode → Libera.Chat, Mailman → Fedora Discussion, openjdk.java.net → openjdk.org)
  - installing-plugins-for-playing-movies-and-music.adoc: updated for F41+; OpenH264 content merged in; RPM Fusion noted for extended codec support; immutable editions section added; Fedora Workstation multimedia group updated
  - installing-chromium-or-google-chrome-browsers.adoc: DNF4 old-syntax block removed;   chromium-freeworld from RPM Fusion noted for users needing full codec support; screenshots updated  for current GNOME Software and Plasma Discover UI
  - fonts.adoc: rewritten for current Fedora; GNOME Font Viewer bug note removed; KDE section updated for Plasma 6; RPM Fusion font source note corrected; code block formatting fixed
  - finding-and-installing-linux-applications.adoc: repository overview section removed (now links to dedicated topics); GNOME and KDE GUI walkthroughs updated with fresh screenshots on Fedora 42 with GNOME 50 and Plasma 6; category descriptions corrected to match actual UI
  - switching-desktop-environments.adoc : renamed "Installing and Switching Desktop Environments";  updated for Fedora 41+ (single dnf environment list command) --- worth noting that although I could install switchdesk it didn't really work properly in my test lab.
  - fedora-and-software-patents.adoc: dead links removed (Fluendo, 2007–2010 Red Hat press releases,  old mailing list); MP3 no longer referenced as patent-encumbered (patents expired 2017)

 *Style and consistency pass*

  All topics in the section were run through the Red Hat Vale linter. Changes include: contractions  expanded, passive voice reduced, heading capitalisation normalised (sentence  case for H2+), code blocks annotated with [source,bash,console] and $/$ sudo prompts, e.g./i.e. replaced with for example/that is, and Fedora-specific vocabulary added to the Vale exceptions file.

 *Screenshots*

  All screenshots in finding-and-installing-linux-applications.adoc are retaken on Fedora 42 (GNOME 50 and Plasma 6), replacing images from the older Fedora releases.

Reviewed-on: #969
2026-05-26 10:24:12 +00:00

4.4 KiB
Raw Permalink Blame History

A local DNF repository mirror lets you serve Fedora package updates from your own infrastructure. This is useful for organisations managing multiple Fedora systems, restricted or metered network environments, or testing updates on a staging system before rolling them out to production.

Prerequisites

Disk space

Use dnf repoinfo to check the size of each repository you plan to mirror:

$ dnf repoinfo fedora updates

The Repodate Info: Size fields in the output show the total package size for each repository. Run the same command for any additional repositories you want to mirror, using dnf repolist to see available repository IDs.

Note
Repository size grows throughout a release lifecycle as updates accumulate. The updates repository in particular grows steadily from release day until end-of-life. Budget additional headroom beyond the initial estimate. Repositories can grow by up to 30% or more over the lifecycle of a release, so plan accordingly.

Installing dnf5-plugins

The dnf reposync command comes from the dnf5-plugins package:

$ sudo dnf install dnf5-plugins

An HTTP server

A web server is required to serve the mirrored content to other systems. This guide uses Apache httpd, but nginx works equally well.

$ sudo dnf install httpd
$ sudo systemctl enable --now httpd

Syncing the repository

Use dnf reposync to download repository content to a local directory. The following example syncs the fedora and updates repositories:

$ sudo dnf reposync --repo=fedora --repo=updates --download-path=/var/www/html/mirror

To limit the sync to specific architectures and avoid downloading packages you do not need:

$ sudo dnf reposync --repo=fedora --repo=updates --download-path=/var/www/html/mirror --arch=x86_64 --arch=noarch

To remove packages from the local mirror that are no longer present in the remote repository:

$ sudo dnf reposync --repo=fedora --repo=updates --download-path=/var/www/html/mirror --delete

The synced content is now accessible at http://localhost/mirror/, or whatever your servers hostname or IP address is.

Note
The first sync downloads the full repository and can take a long time depending on your connection. Later syncs only download new or changed packages.

Configuring client systems

On each system that should use the local mirror, create a .repo file in /etc/yum.repos.d/. For example, /etc/yum.repos.d/local-mirror.repo:

[local-fedora]
name=Local Fedora mirror
baseurl=http://mirror-server/mirror/fedora/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch

[local-updates]
name=Local Fedora updates mirror
baseurl=http://mirror-server/mirror/updates/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch

Replace mirror-server with the hostname or IP address of your mirror server.

To ensure clients use only the local mirror, disable the default Fedora repositories by setting enabled=0 in /etc/yum.repos.d/fedora.repo and /etc/yum.repos.d/fedora-updates.repo.

GPG verification

dnf reposync downloads repository metadata and packages including their signatures. Clients use the Fedora GPG keys already present at /etc/pki/rpm-gpg/ to verify packages, so no additional key configuration is required.

Keeping the mirror current

Set up a systemd service and timer to sync the mirror automatically.

Create a service file at /etc/systemd/system/dnf-mirror.service:

[Unit]
Description=Sync DNF repository mirror

[Service]
Type=oneshot
ExecStart=dnf reposync --repo=fedora --repo=updates --download-path=/var/www/html/mirror --delete

Create the timer at /etc/systemd/system/dnf-mirror.timer:

[Unit]
Description=Daily DNF repository mirror sync

[Timer]
OnCalendar=daily
Persistent=true

[Install]
WantedBy=timers.target

Enable and start the timer:

$ sudo systemctl enable --now dnf-mirror.timer

Verify the timer is active:

$ systemctl status dnf-mirror.timer