meta_package_manager.managers.microdnf module¶
- class meta_package_manager.managers.microdnf.MicroDNF[source]¶
Bases:
PackageManagerA minimal
dnfwritten in C on top of libdnf, for containers.The minimal container images of the RHEL family install it instead of
dnf: AlmaLinux 10’s listsmicrodnfand nodnf. On a host that has both,microdnfand 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
microdnfname as a symlink todnf5(dnf5.spec). NomicrodnfRPM package is installed there, so this manager reports no version and leaves that binary to dnf5.Caution
microdnfkeeps 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/metadatais missing, which is the stateclean allleaves.searchandoutdatedalso fail once the repository metadata expires, withfailed to obtain lock 'metadata'.mpm --microdnf syncrunsmakecachewithsudoto rebuild the cache.microdnfhas no autoremove and no self-check, sompmoffers no orphan operations and nodoctorfor it. Itsleavescommand is no substitute: it lists every installed package that nothing else requires, including the packages installed on request.Initialize
cli_errorslist.- maintenance_note: str | None = 'Superseded by [dnf5](https://github.com/rpm-software-management/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.'¶
A watch note about a still-maintained upstream whose activity is slowing or whose status is ambiguous, as a MyST markdown block.
Unlike
unmaintained, this is purely informational: the manager stays in the default selection and in the test matrices. It renders as a{note}admonition atop the manager’s documentation page, flagging upstreams worth keeping an eye on (a slow release cadence, superseded-but-still-shipped tools, a discontinued platform still under vendor support). May embed markdown links. Mutually exclusive withunmaintained: a confirmed-dead manager carries anunmaintained_messageinstead. Enforced bytest_maintenance_note.
- name: str = 'microdnf'¶
Return package manager’s common name.
Default value is based on class name.
- repository_url: str | None = 'https://github.com/rpm-software-management/microdnf'¶
Repository holding the project’s code, or
Nonewhen it has no public one.Linked from the manager’s documentation page. Also what the weekly metrics sample reads:
docs/docs_update.pywrites it into the[tool.repomatic.metrics] subjectsofpyproject.tomlwhen its forge answers the sampler, through a mirror for a forge that does not.Never inherited, for the same reason as
wikipedia_url: the AUR helpers extendingpacmaneach live in a repository of their own.
- logo: str | None = 'fedora'¶
Slug of the brand mark standing for this manager in the documentation.
Names an SVG vendored under
docs/assets/managers/, whose provenance and license are recorded indocs/assets/managers/logos.yaml. Inlined at the top of the manager’s page bymeta_package_manager._docs; a manager leaving it unset keeps the page’s default package glyph.Several managers legitimately share one slug, either because they wrap the same upstream (
brewandcask) or because the tool has no mark of its own and its ecosystem’s stands in (aptunder Debian’s swirl,cargounder Rust’s gear). Documentation-only, likehomepage_url: no CLI output reads it.
- platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='almalinux', name='AlmaLinux'), Platform(id='alpine', name='Alpine Linux'), Platform(id='altlinux', name='ALT Linux'), Platform(id='amzn', name='Amazon Linux'), Platform(id='android', name='Android'), Platform(id='arch', name='Arch Linux'), Platform(id='buildroot', name='Buildroot'), Platform(id='cachyos', name='CachyOS'), Platform(id='centos', name='CentOS'), Platform(id='chromeos', name='ChromeOS'), Platform(id='clearlinux', name='Clear Linux OS'), Platform(id='cloudlinux', name='CloudLinux OS'), Platform(id='crux', name='CRUX'), Platform(id='debian', name='Debian'), Platform(id='endeavouros', name='EndeavourOS'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='kali', name='Kali Linux'), Platform(id='kvmibm', name='KVM for IBM z Systems'), Platform(id='linuxmint', name='Linux Mint'), Platform(id='mageia', name='Mageia'), Platform(id='mandriva', name='Mandriva Linux'), Platform(id='manjaro', name='Manjaro Linux'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='nutyx', name='NuTyX'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='parallels', name='Parallels'), Platform(id='pidora', name='Pidora'), Platform(id='pikaos', name='PikaOS'), Platform(id='raspbian', name='Raspbian'), Platform(id='rhel', name='RedHat Enterprise Linux'), Platform(id='rocky', name='Rocky Linux'), Platform(id='scientific', name='Scientific Linux'), Platform(id='slackware', name='Slackware'), Platform(id='sles', name='SUSE Linux Enterprise Server'), Platform(id='slitaz', name='SliTaz GNU/Linux'), Platform(id='solus', name='Solus'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='tuxedo', name='Tuxedo OS'), Platform(id='ubuntu', name='Ubuntu'), Platform(id='ultramarine', name='Ultramarine'), Platform(id='void', name='Void Linux'), Platform(id='wsl1', name='Windows Subsystem for Linux v1'), Platform(id='wsl2', name='Windows Subsystem for Linux v2'), Platform(id='xenserver', name='XenServer')})¶
List of platforms supported by the manager.
Allows for a mishmash of platforms and groups of platforms. Will be normalized into a
frozensetofPlatforminstances at instantiation.
- default_sudo: bool = True¶
Built-in escalation default, used when
sudoisNone.Falseon the base: most managers install into user-writable trees and never need root. The system package managers whose privileged operations require root (apt,dnf,pacman,zypper, …) set this toTrueso theirbuild_cli(..., sudo=True)operations escalate out of the box, while staying switchable off throughsudo(--no-sudoor config) for rootless setups.
- requirement: str | None = '>=3.8.0'¶
3.8.0is the first release with themakecachecommand thatsyncruns (rpm-software-management/microdnf@e2d56ee). Everything else is older:--assumeno, whichoutdatedneeds, shipped in3.7.0, andrepoqueryin3.4.0.
- version_cli: str | None = 'rpm'¶
microdnfhas no version option. It ignores--version, prints its usage andNo command specifiedto stderr, and exits1. So the probe asks RPM for the version of themicrodnfpackage instead.rpm --querymatches package names, never the capabilities a package provides. That is why the probe finds nothing where dnf5 provides amicrodnfsymlink.
- version_cli_options: tuple[str, ...] = ('--query', '--queryformat', '%{VERSION}', 'microdnf')¶
CLI options used to produce the version of the package manager.
The raw output produced by the package manager CLI will be parsed with the
version_regexesbelow to extract the version number.
- version_regexes: tuple[str, ...] = ('^(?P<version>\\d\\S*)$',)¶
Anchored at both ends: a host without the package answers with the sentence
package microdnf is not installed, which must match nothing.$ rpm --query --queryformat %{VERSION} microdnf 3.10.1
- property installed: Iterator[Package]¶
Fetch installed packages.
$ 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
- property outdated: Iterator[Package]¶
Fetch outdated packages.
microdnfhas no command that lists pending updates. Sompmreads the transactionupgradewould run, which--assumenorefuses before anything changes. The command exits0either way, withOperation aborted.after the table, orNothing to do.alone.An upgraded package is a row under
Upgrading:, followed by areplacingrow that names the installed version. An install-only package, like the kernel, is a row underInstalling:instead: RPM installs its new version beside the old one. New dependencies show up in that section too, so a second query reads which of those names are installed, and skips the others.$ 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
- cli_names: tuple[str, ...] = ('microdnf',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- homepage_url: str | None = None¶
Home page of the project, only used in documentation for reference.
Left unset when the home page is the project’s repository, which
repository_urlnames on its own. Never inherited, like the other links.
- id: str = 'microdnf'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.
- search(query, extended, exact)[source]¶
Fetch matching packages.
Caution
repoquerymatches package names only, never summaries. The match ignores case and also accepts aname-versionform, someta_package_manager.manager.PackageManager.refiltered_search()refines the exact results.A repository can keep several builds of a package, and
repoqueryprints a row for each. Only the newest build is reported.$ microdnf repoquery *xxd* xxd-2:9.1.083-9.el10_2.2.aarch64 xxd-2:9.1.083-9.el10_2.3.aarch64 xxd-2:9.1.083-9.el10_2.4.aarch64 xxd-2:9.1.083-9.el10_2.7.aarch64 xxd-2:9.1.083-9.el10_2.12.aarch64 xxd-2:9.1.083-9.el10_2.20.aarch64
$ microdnf repoquery xxd xxd-2:9.1.083-9.el10_2.2.aarch64 xxd-2:9.1.083-9.el10_2.3.aarch64 xxd-2:9.1.083-9.el10_2.4.aarch64 xxd-2:9.1.083-9.el10_2.7.aarch64 xxd-2:9.1.083-9.el10_2.12.aarch64 xxd-2:9.1.083-9.el10_2.20.aarch64
- virtual: bool = False¶
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- wikipedia_url: str | None = None¶
English Wikipedia article about the project, or
Nonewhen it has none.Listed after
homepage_urlin the links of the manager’s documentation page. The article covers the project that home page names, or is a redirect Wikipedia keeps under the project’s name, landing on the part of a broader article that describes it:Cargo_(software)opens the Cargo section of the Rust article. An article that merely mentions the project does not count, nor does one about a related subject:lazyis a Neovim plugin manager, and the Neovim article is not about it.Never inherited: the metaclass resets it to
Noneon any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extendingpacman, and would otherwise present pacman’s article as its own. Documentation-only, likehomepage_url.
- install(package_id, version=None)[source]¶
Install one package, optionally pinned to a version.
microdnfresolvesname-versionthe way it resolves a bare name, so a pin joins the two with a dash. The epoch and the release are optional: a version without a release installs the newest build of that version.$ sudo microdnf --assumeyes install tree
$ sudo microdnf --assumeyes install xxd-2:9.1.083-9.el10_2.3
- Return type:
- upgrade_all_cli()[source]¶
Generates the CLI to upgrade all outdated packages.
$ sudo microdnf --assumeyes upgrade
- upgrade_one_cli(package_id, version=None)[source]¶
Generates the CLI to upgrade one package, optionally to a version.
The version joins the package ID the way it does for
install.$ sudo microdnf --assumeyes upgrade tree
$ sudo microdnf --assumeyes upgrade xxd-9.1.083-9.el10_2.12
- remove(package_id)[source]¶
Remove one package and one only.
$ sudo microdnf --assumeyes remove tree
- Return type: