dnf5

Provides in-depth reference documentation for the dnf5 RPM package manager on Fedora and RHEL.

1.9k|142|Updated Apr 20, 2020
One-click install
npx skills add https://github.com/carapace-sh/carapace-bin --skill dnf5
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dnf5
Source: https://github.com/carapace-sh/carapace-bin/tree/main/skills/dnf5
Command: npx skills add https://github.com/carapace-sh/carapace-bin --skill dnf5

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Working with dnf5 requires navigating a large surface area: CLI commands, configuration options, plugin APIs, the D-Bus daemon, modularity, caching, and migration differences from DNF4. This Skill consolidates that knowledge into structured references so you get accurate answers without digging through scattered man pages and source code.

Core Features & Use Cases

  • CLI and Configuration Reference: Covers all dnf5 commands, global options, exit codes, environment variables, and every dnf.conf option with types and defaults.
  • Architecture and Internals: Documents the libdnf5 C++ library, the two-tier plugin system, the dnf5daemon D-Bus API with polkit authorization, and the execution workflow with plugin hooks.
  • Specialized Topics: Explains NEVRA package specs, modularity and stream filtering, caching behavior, installroot and forcearch usage, repo variables, TOML command aliases, and DNF4-to-DNF5 migration changes.
  • Use Case: When writing a dnf5 plugin, load the plugins reference to learn the IPlugin interface, API versioning, and hook lifecycle; when scripting against the daemon, load the daemon reference for session management and D-Bus method signatures.

Quick Start

Ask how to configure dnf5 repository options or how the dnf5daemon D-Bus API works, and the matching reference will be loaded to answer.

Frequently Asked Questions about dnf5

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure dnf5 repository and main options?

Edit /etc/dnf/dnf.conf for main options and .repo files in /etc/yum.repos.d for per-repository settings. Drop-in directories /etc/dnf/libdnf5.conf.d and /etc/dnf/repos.override.d apply overrides in alphabetical order, with the last option winning.

What changed from DNF4 to DNF5?

DNF5 renamed updateinfo to advisory, made subcommands mandatory, dropped options like --downloaddir and -4/-6, changed best default to true, and made cacheonly an enum. The strict option was split into skip_broken and skip_unavailable.

How does the dnf5daemon D-Bus API work?

The daemon exposes org.rpm.dnf.v0 on the system bus. Clients call open_session on the SessionManager to get a session object, then use interfaces like Rpm, Goal, Repo, and Advisory for package operations, with polkit handling authorization.

Does dnf5 support modularity and module streams?

Yes, when built with WITH_MODULEMD. Only packages from active module streams appear in the available set, with fail-safe copies of modulemd kept for unavailable repos. Note that Fedora discontinued modularity support starting with Fedora 39.

How do I write a dnf5 or libdnf5 plugin?

Implement the IPlugin interface for dnf5 CLI plugins or the libdnf5 plugin API for library plugins, exporting the appropriate get_api_version function. Plugins hook into lifecycle points like pre_base_setup, repos_loaded, goal_resolved, and pre_transaction.

Why does dnf5 fail when creating a new installroot?

A fresh installroot has an empty RPMDB, so $releasever cannot be detected and transactions fail. Pass --releasever explicitly, and set module_platform_id via --setopt on modular systems to avoid unsatisfied modular dependencies.