dnf5
Manage software packages with dnf5
TLDR
Upgrade installed packages to the newest available versions
Search packages via keywords
Display details about a package
Install new packages (Note: Use -y to confirm all prompts automatically)
Remove packages
List installed packages
Find which packages provide a given command
Remove or expire cached data
SYNOPSIS
dnf5 [options] <command> [<args>]
PARAMETERS
--assumeyes, -y
Automatically answer "yes" to prompts.
--assumeno
Automatically answer "no" to prompts.
--best
Resolve dependencies using the best available versions.
--allowerasing
Allow erasing packages to resolve dependencies.
--skip-broken
Skip packages with broken dependencies.
--refresh
Update metadata before running the command.
--cacheonly
Use cached metadata only, no downloads.
--downloadonly
Download packages but do not install.
--installroot=PATH
Set alternate installation root.
--releasever=VER
Set release version for repositories.
--enablerepo=ID
Enable specific repository(s) for this transaction.
--disablerepo=ID
Disable specific repository(s) for this transaction.
--exclude=PKG
Exclude packages from updates.
--config=FILE
Use alternative config file.
--setopt=option=value
Override runtime options.
-v, --verbose
Increase verbosity level.
-q, --quiet
Quiet operation, less output.
--version
Display version information.
--help
Show help message.
-C
Run without updating filelists database.
DESCRIPTION
DNF5 is the modern successor to the DNF package manager, serving RPM-based distributions like Fedora, RHEL, and CentOS Stream. It offers a command-line interface for installing, updating, removing, and querying software packages, handling dependencies, repositories, and system updates efficiently.
Powered by the new libdnf5 library in C++17, DNF5 delivers superior performance through a faster SAT solver (libsolv-based), modular architecture, and optimized RPM backend. Features include atomic transactions, goal-based management via Goalfile, enhanced plugin support, better error diagnostics, and composability for tools like microdnf.
Maintaining API compatibility with DNF4, it supports familiar workflows while introducing improvements like metadata prefetching, selective repo enabling, and advanced querying. DNF5 excels in large-scale environments, reducing solve times and memory usage. Ideal for servers, desktops, and containers, it ensures secure GPG verification and flexible configuration.
Transitioning is straightforward; most scripts and habits carry over, with gains in speed and reliability.
CAVEATS
DNF5 is actively developed; some DNF4 plugins lack ports. Metadata format differs slightly from DNF4—ensure repo compatibility. Not yet fully stable in all edge cases.
COMMON SUBCOMMANDS
install, reinstall, upgrade, update, remove, autoremove, search, list, info, provides, repoquery, clean, history, makecache.
EXAMPLES
dnf5 update
Update all packages.
dnf5 install package
Install specified package.
dnf5 search keyword
Search for packages.
HISTORY
DNF5 emerged from Fedora Project in 2022 to replace aging DNF4. Rewritten with libdnf5 in C++ for modularity and speed, it debuted in Fedora 38 (2023 alpha), matured in 39/40 betas, and became default in Fedora 42 (2024). Focuses on solver efficiency, goal management, and ecosystem integration amid shift to OSTree/ rpm-ostree.


