What are DNF repositories and how do you manage them?
Repositories are the package sources DNF installs from; dnf repolist shows them and dnf config-manager enables, disables, or adds new ones (config lives in /etc/yum.repos.d/).
DNF can only install what some repository offers — a server hosting packages plus the metadata DNF needs to resolve dependencies. Managing them:
| Command | Purpose |
|---|---|
dnf repolist |
List enabled repos |
dnf repolist all |
List all repos (enabled + disabled) |
dnf config-manager --enable REPO |
Turn a repo on |
dnf config-manager --disable REPO |
Turn a repo off |
dnf config-manager --add-repo URL |
Add a new repo |
dnf repolist all
# rhel-9.0-...-baseos-rpms RHEL 9.0 BaseOS enabled
# rhel-9.0-...-appstream RHEL 9.0 AppStream enabled
dnf config-manager --add-repo="https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/"
Each repo is defined by a .repo file in /etc/yum.repos.d/. On RHEL the two core repos are:
- BaseOS — the core operating system packages.
- AppStream — applications, languages, and developer tools (where the modules live).
Adding sources widens what you can install: a popular third-party repo is EPEL (Extra Packages for Enterprise Linux), which provides well-maintained software not shipped in RHEL itself. Enabling a repo is how you go beyond the base distribution — at the cost of trusting that source's packages.
Go deeper:
DNF command reference — repolist —
repolistand repository handling.