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
- 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
- Source
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.
microdnf has no autoremove and no self-check, so mpm offers no orphan
operations and no doctor for it. Its leaves command is no substitute:
it lists every installed package that nothing else requires, including the
packages installed on request.
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 |
With |
|---|---|---|
List what’s installed |
|
|
List outdated packages |
|
|
Search for a package |
|
|
Install a package |
|
|
Upgrade one package |
|
|
Upgrade everything |
|
|
Remove a package |
|
|
Clear caches |
|
|
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 |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
||
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
Selecting and configuring microdnf¶
Deselect microdnf for a single run with --no-microdnf, or persist the choice in your configuration:
[mpm]
microdnf = false
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.overrides.microdnf]
timeout = 900
mpm config-template microdnf prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around microdnf, one mpm command each:
Snapshot and clone a machine:
mpm --microdnf dump microdnf.toml, thenmpm restore microdnf.tomlon the next one.Export a compliance SBOM:
mpm --microdnf sbom(CycloneDX by default,--spdxfor 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.
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 againstftp.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.
Version probe¶
The version is probed by running:
$ rpm --query --queryformat %{VERSION} microdnf
3.10.1
and extracted with:
r"^(?P<version>\d\S*)$"
Reference traces¶
Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. 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
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --microdnf installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
8.0.0.dev0(unreleased)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.