microdnf

Note

Superseded by dnf5 on Fedora, and on RHEL releases after 10. The C implementation stays maintained for RHEL 10 and older, whose minimal images ship it; mpm wraps dnf5 as a separate manager.

ID

microdnf

Link

Repository

Upstream stars

⭐ 249

Last commit

2026-04-15

Version requirement

>= 3.8

Platforms

🐧 Linux

Operations

installed · outdated · search · install · upgrade · upgrade_all · remove · sync · cleanup

purl types

pkg:microdnf/ · pkg:rpm/

CLI name

microdnf

Issues and PRs

📦 manager: rpm-based

Source

microdnf.py

A minimal dnf written in C on top of libdnf, for containers.

The minimal container images of the RHEL family install it instead of dnf: AlmaLinux 10’s lists microdnf and no dnf. On a host that has both, microdnf and dnf read the same RPM database, so their listings overlap.

Note

On Fedora, and on RHEL releases after 10, the dnf5 package takes over the microdnf name as a symlink to dnf5 (dnf5.spec). No microdnf RPM package is installed there, so this manager reports no version and leaves that binary to dnf5.

Caution

microdnf keeps one system-wide cache under /var/cache/yum, and only root can write to it. As a regular user, every query fails while /var/cache/yum/metadata is missing, which is the state clean all leaves. search and outdated also fail once the repository metadata expires, with failed to obtain lock 'metadata'. mpm --microdnf sync runs makecache with sudo to rebuild the cache.

What mpm adds to microdnf

Through mpm, microdnf gains --exact and --extended search, to narrow to exact names or match descriptions.

Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover microdnf alongside dnf, dnf5, urpmi, yum, zypper and any other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.

Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.

Your microdnf commands, in mpm

You already know microdnf: each operation maps one-to-one onto mpm, in an interface shared by every manager.

To…

With microdnf

With mpm

List what’s installed

microdnf repoquery --installed

mpm --microdnf installed

List outdated packages

microdnf --assumeno upgrade

mpm --microdnf outdated

Search for a package

microdnf repoquery *xxd*

mpm --microdnf search <pkg>

Install a package

sudo microdnf --assumeyes install tree

mpm install pkg:microdnf/tree

Upgrade one package

sudo microdnf --assumeyes upgrade tree

mpm --microdnf upgrade tree

Upgrade everything

sudo microdnf --assumeyes upgrade

mpm --microdnf upgrade --all

Remove a package

sudo microdnf --assumeyes remove tree

mpm remove pkg:microdnf/tree

Clear caches

sudo microdnf clean all

mpm --microdnf cleanup --cache

Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.

Operations

Operation

Supported

Notes

installed

✅

outdated

✅

orphans

❌

No autoremove exists, and the leaves command lists every installed package that nothing else requires.

search

✅

Exact and extended search backfilled by mpm.

install

✅

upgrade

✅

upgrade_all

✅

remove

✅

sync

✅

cleanup

✅

doctor

❌

The tool ships no diagnostic command of its own.

Configuration

  • Ignore microdnf on the mpm CLI by passing the --no-microdnf option.

  • Ignore it for every run in your configuration:

    [mpm]
    microdnf = false
    
  • Raise the timeout of all microdnf calls:

    [mpm.overrides.microdnf]
    timeout = 900
    
  • Run mpm config-template microdnf to print all overridable settings for your configuration file:

    [mpm.overrides.microdnf]
    cli_names = [
        "microdnf",
    ]
    cli_search_path = []
    dry_run = false
    ignore_auto_updates = true
    plan = false
    post_args = []
    pre_args = []
    pre_cmds = []
    requirement = ">=3.8.0"
    stop_on_error = false
    unmaintained = false
    version_cli_options = [
        "--query",
        "--queryformat",
        "%{VERSION}",
        "microdnf",
    ]
    version_regexes = [
        "^(?P<version>\\d\\S*)$",
    ]
    

Recipes

A few jobs you would otherwise script around microdnf, one mpm command each:

  • Snapshot and clone a machine: mpm --microdnf dump microdnf.toml, then mpm restore microdnf.toml on the next one.

  • Export a compliance SBOM: mpm --microdnf sbom (CycloneDX by default, --spdx for SPDX).

Privilege escalation

System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.

Its privileged operations are cleanup, install, remove, sync, upgrade, upgrade_all.

See privilege escalation for the full policy.

Concurrency

mpm never runs microdnf at the same time as dnf, dnf5, urpmi, yum or zypper: they all reach the RPM database, where a second writer either waits for the first one to finish or fails on its lock. Each mutating operation waits for the previous one, even with a higher --jobs, while managers outside this group keep running in parallel.

Only mutations are held back. The read-only queries (installed, outdated, search) take no backend lock and stay fully concurrent.

Cooldown

State of microdnf’s release-age gating, from the cooldown support table:

Status: ❌ None (effort focused on dnf5)

A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:

  • Registry: Distro binary archives (pkg:deb, pkg:rpm, pkg:alpm, pkg:apk)

  • Retraction: Index revert: removal is an archive operation and the mirror is rebuilt without the package. Debian, for one, requires filing an RM: bug against ftp.debian.org (developers-reference)

  • Publish date: ❌ the version string is the distro maintainer’s build, carrying no upstream publication date

With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --cooldown best-effort opts back in.

Reference traces

A collection of raw native outputs captured from the manager’s own CLI and recorded in the manager source. If you know microdnf well and a transcript below looks wrong, or a newer release changed its output format, report it.

$ microdnf repoquery --installed
NetworkManager-1:1.56.0-2.el10_2.aarch64
NetworkManager-libnm-1:1.56.0-2.el10_2.aarch64
NetworkManager-tui-1:1.56.0-2.el10_2.aarch64
almalinux-gpg-keys-10.2-21.el10.aarch64
almalinux-release-10.2-21.el10.aarch64
almalinux-repos-10.2-21.el10.aarch64
alternatives-1.30-2.el10.aarch64
attr-2.5.2-5.el10.aarch64
$ microdnf --assumeno upgrade
Package                                             Repository     Size
Installing:
 kernel-6.12.0-211.53.1.el10_2.aarch64              baseos       1.7 MB
 kernel-core-6.12.0-211.53.1.el10_2.aarch64         baseos      19.9 MB
 kernel-modules-6.12.0-211.53.1.el10_2.aarch64      baseos      28.3 MB
 kernel-modules-core-6.12.0-211.53.1.el10_2.aarch64 baseos      26.6 MB
Upgrading:
 rsync-3.5.0-3.el10_2.aarch64                       baseos     474.3 kB
  replacing rsync-3.4.4-1.el10_2.aarch64
 tar-2:1.35-13.el10_2.aarch64                       baseos     884.5 kB
   replacing tar-2:1.35-11.el10.aarch64
Transaction Summary:
 Installing:        4 packages
 Reinstalling:      0 packages
 Upgrading:         2 packages
 Obsoleting:        0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Operation aborted.
$ microdnf repoquery --installed kernel kernel-core kernel-modules kernel-modules-core
kernel-6.12.0-211.47.1.el10_2.aarch64
kernel-core-6.12.0-211.47.1.el10_2.aarch64
kernel-modules-6.12.0-211.47.1.el10_2.aarch64
kernel-modules-core-6.12.0-211.47.1.el10_2.aarch64

Version check

The version is probed by running:

$ rpm --query --queryformat %{VERSION} microdnf
3.10.1

and extracted with:

r"^(?P<version>\d\S*)$"

Upstream project

Metrics

rpm-software-management/microdnf

Activity

commit activity commits since open issues open pull requests

Popularity

forks watchers contributors

Metadata

latest release release date license main language

Changelog

  • 8.0.0 (2026-09-20)

    • Add microdnf, the package manager of RHEL-family minimal images, with inventory, outdated, name search, version-pinned install and upgrade, remove, sync and cache cleanup.