LinuxCommandLibrary

dnf5

Manage software packages with dnf5

TLDR

Upgrade installed packages to the newest available versions

$ sudo dnf5 upgrade
copy

Search packages via keywords
$ dnf5 search [keyword1 keyword2 ...]
copy

Display details about a package
$ dnf5 info [package]
copy

Install new packages (Note: Use -y to confirm all prompts automatically)
$ sudo dnf5 install [package1 package2 ...]
copy

Remove packages
$ sudo dnf5 remove [package1 package2 ...]
copy

List installed packages
$ dnf5 list --installed
copy

Find which packages provide a given command
$ dnf5 provides [command]
copy

Remove or expire cached data
$ sudo dnf5 clean all
copy

SYNOPSIS

dnf5 [options] <command> [arguments]

Common commands include:
dnf5 install [package...]
dnf5 remove [package...]
dnf5 update [package...]
dnf5 check-update
dnf5 search [keyword...]
dnf5 info [package...]
dnf5 list [package-spec...]
dnf5 history
dnf5 clean [all|packages|metadata|expire-cache|dbcache|plugins|binaries|rpmdb|timestamps]
dnf5 repolist [all|enabled|disabled]

PARAMETERS

--assumeyes, -y
    Automatically answer yes to all questions during an operation.

--cacheonly
    Run entirely from cached data, do not update metadata or download new files.

--config=<file>
    Specify an alternative configuration file path.

--downloaddir=<path>
    Specify a directory to download packages to, instead of the default cache.

--installroot=<path>
    Specifies an alternative installroot, allowing operations on a different system root.

--nogpgcheck
    Disable GPG signature checking for packages and metadata.

--releasever=<version>
    Override the value of the '$releasever' variable in configuration files.

--setopt=<option>
    Set any configuration option in the format 'name=value'.

--skip-broken
    Skip packages with broken dependencies, attempting to complete the transaction otherwise.

--verbose, -v
    Output more detailed debugging information.

DESCRIPTION

dnf5 is the successor to the dnf (Dandified YUM) package manager, primarily used in Fedora, Red Hat Enterprise Linux, and CentOS. It represents a significant evolution, aiming for improved performance, better resource utilization, and a more robust architecture. Unlike dnf, which is largely Python-based, dnf5 is rewritten in C++ using the libsolv library, leading to substantial speed improvements in metadata parsing, dependency resolution, and transaction execution. It maintains a command-line interface very similar to dnf for ease of transition, while offering new capabilities and a more modular design. dnf5 aims to be the future default package manager, providing a modern, efficient, and reliable solution for managing software packages on RPM-based systems, enhancing the user experience for system administrators and developers alike.

CAVEATS

As of early 2024, dnf5 is still in active development and adoption. While it's becoming default in some newer Fedora releases (e.g., Fedora 40), it may not be universally available or the primary package manager on all RPM-based distributions yet. Users should be aware of potential differences in plugin compatibility and internal API changes for developers compared to dnf. Always test critical operations in a non-production environment first.

CORE TECHNOLOGIES

dnf5 is built primarily on libsolv for dependency resolution and librepo for repository management and package downloading. Both libraries are written in C, contributing to dnf5's significant performance gains and lower memory footprint compared to its Python-based predecessor.

API STABILITY

A key goal for dnf5 is to provide stable and well-defined C++ APIs. This allows other applications and tools to interact directly with the package management system in a consistent and reliable manner, fostering deeper integration and reducing the need for parsing command-line output.

HISTORY

The history of package management in Fedora/RHEL began with yum (Yellowdog Updater, Modified). Due to its limitations in performance and dependency resolution, particularly for complex scenarios, dnf was introduced as its successor. dnf, initially based on Python and leveraging libsolv, brought significant improvements. However, a desire for even greater performance, lower memory footprint, and a more robust, stable C++ API led to the development of dnf5. It represents a complete rewrite in C++, aiming to build upon the successes of dnf while addressing its architectural limitations, particularly those related to its Python core. Development for dnf5 began to lay the groundwork for the next decade of RPM-based package management.

SEE ALSO

dnf(8), yum(8), rpm(8), libsolv(3), librepo(3)

Copied to clipboard