meta_package_manager.managers.dnf module¶

class meta_package_manager.managers.dnf.DNF[source]¶

Bases: PackageManager

Fedora’s RPM package manager.

The DNF5 and YUM subclasses reuse everything here, differing only in the binary and forced arguments.

Command equivalences with other managers are listed in Pacman/Rosetta.

Initialize cli_errors list.

maintenance_note: str | None = "DNF 4 is superseded by [dnf5](https://github.com/rpm-software-management/dnf5) (Fedora's default since Fedora 41) but stays maintained for the RHEL 8/9 family; 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 with unmaintained: a confirmed-dead manager carries an unmaintained_message instead. Enforced by test_maintenance_note.

operation_notes: ClassVar = {'remove': 'Removing a package also drops the dependencies it leaves orphaned, since `remove` runs `autoremove`.', 'search': 'Matches names only, with no exact or extended mode.'}¶

Per-operation hints rendered in the Notes column of the manager page’s Operations table.

Keyed by the Operations member name, each value is a single short sentence explaining why the manager lacks the operation, or what makes its implementation partial: the pointer a reader needs to judge whether the gap is one they could help close. Each sentence starts with a capital and closes with a period, and starts on a word rather than a code span, so the cell reads standalone beside its row. A blank cell stays silent: a manager documenting nothing documents no gap.

The full rationale never lives here: it belongs in a comment beside the implementing method (or beside this declaration, for an operation with no method to hang it on), so the sentence on the page stays a hint and the code keeps the story. The class docstring follows the same split: it keeps only what a user needs to run the tool day to day, never how mpm wraps it.

Validated by test_operation_notes, which also checks every key matches a real operation: a key outside the enum’s vocabulary would never reach a page.

name: str = 'Fedora DNF'¶

Return package manager’s common name.

Default value is based on class name.

documentation_url: str | None = 'https://dnf.readthedocs.io/en/latest/command_ref.html'¶

Entry point of the project’s own documentation, or None when it has none.

The manual, the documentation site, or the man page of the CLI mpm drives: whichever page a user reads to learn the commands this manager wraps. Listed between homepage_url and repository_url in the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.

Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README repository_url already reaches. A page about the ecosystem rather than the tool does not qualify either.

Where a project’s only site is its manual, that address belongs here and homepage_url stays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.

Never inherited, like every other link: the AUR helpers extending pacman each document themselves.

repository_url: str | None = 'https://github.com/rpm-software-management/dnf'¶

Repository holding the project’s code, or None when it has no public one.

Linked from the manager’s documentation page. Also what the weekly metrics sample reads: docs/docs_update.py writes it into the [tool.repomatic.metrics] subjects of pyproject.toml when 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 extending pacman each live in a repository of their own.

wikipedia_url: str | None = 'https://en.wikipedia.org/wiki/DNF_(software)'¶

English Wikipedia article about the project, or None when it has none.

Listed last in 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: lazy is a Neovim plugin manager, and the Neovim article is not about it.

Never inherited: the metaclass resets it to None on any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extending pacman, and would otherwise present pacman’s article as its own. Documentation-only, like homepage_url.

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 in docs/assets/managers/logos.yaml. Inlined at the top of the manager’s page by meta_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 (brew and cask) or because the tool has no mark of its own and its ecosystem’s stands in (apt under Debian’s swirl, cargo under Rust’s gear). Documentation-only, like homepage_url: no CLI output reads it.

keywords: tuple[str, ...] = ('fedora', 'redhat', 'rhel', 'rpm')¶

Well-known names for this manager that its id does not already carry.

Merged into the PyPI keywords of pyproject.toml by update_keywords() of docs/docs_update.py, alongside every manager ID and the globally curated KEYWORDS_EXTRAS. Declare an alias here rather than in that tuple whenever it names this manager: an alias living beside the class it describes cannot outlive it, where a central entry silently rots once the manager is renamed or dropped.

Reserve KEYWORDS_EXTRAS for terms belonging to no manager in particular, like cyclonedx or package manager. Documentation-only: no CLI output reads it.

Each keyword also becomes a content rule of the issue labeller, so its precision bar applies here: see generate_content_rules(). A subclass inherits the terms of its parent without claiming them, since test_manager_keywords_have_one_owner reads what a class declares itself.

platforms: frozenset[Platform] | Group | Platform | Iterable[Platform | Group] = frozenset({Platform(id='aix', name='IBM AIX'), 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='cygwin', name='Cygwin'), Platform(id='debian', name='Debian'), Platform(id='dragonfly_bsd', name='DragonFly BSD'), Platform(id='endeavouros', name='EndeavourOS'), Platform(id='exherbo', name='Exherbo Linux'), Platform(id='fedora', name='Fedora'), Platform(id='freebsd', name='FreeBSD'), Platform(id='generic_linux', name='Generic Linux'), Platform(id='gentoo', name='Gentoo Linux'), Platform(id='guix', name='Guix System'), Platform(id='haiku', name='Haiku'), Platform(id='hurd', name='GNU/Hurd'), Platform(id='ibm_powerkvm', name='IBM PowerKVM'), Platform(id='illumos', name='illumos'), 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='midnightbsd', name='MidnightBSD'), Platform(id='netbsd', name='NetBSD'), Platform(id='nixos', name='NixOS'), Platform(id='nobara', name='Nobara'), Platform(id='nutyx', name='NuTyX'), Platform(id='openbsd', name='OpenBSD'), Platform(id='opensuse', name='openSUSE'), Platform(id='openwrt', name='OpenWrt'), Platform(id='oracle', name='Oracle Linux'), Platform(id='os400', name='IBM i'), 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='solaris', name='Solaris'), Platform(id='solus', name='Solus'), Platform(id='sourcemage', name='Source Mage GNU/Linux'), Platform(id='sunos', name='SunOS'), 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 frozenset of Platform instances at instantiation.

default_sudo: bool = True¶

Built-in escalation default, used when sudo is None.

False on 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 to True so their build_cli(..., sudo=True) operations escalate out of the box, while staying switchable off through sudo (--no-sudo or config) for rootless setups.

privileged_operations: ClassVar[frozenset[str]] = frozenset({'cleanup', 'install', 'remove', 'upgrade', 'upgrade_all'})¶

Operations with at least one command this manager marks privileged.

Keyed by the Operations member name, like operation_notes. An operation belongs here when a method implementing it passes sudo=True to run_cli() or build_cli(), with the method-to-operation map of METHOD_OPERATIONS. Those commands are the only ones the escalation policy (sudo, else default_sudo) wraps in the escalator. A definition derives the set from the operations it marks sudo = true.

prime_sudo() reads it to prompt only for the managers that escalate a command of the current run. With [mpm.overrides.gem] sudo = true, mpm sync asks for no password: the gem sources --update command of sync carries no marker. test_privileged_operations holds the set to the markers in the method bodies.

requirement: str | None = '>=4.0.0,<5'¶

Ceiling because dnf is no longer dnf4 everywhere.

Fedora 41 and later ship /usr/bin/dnf as a symlink to dnf5, and cli_path returns the first name it finds without consulting the version. So this class is handed a dnf5 binary on a current Fedora, and the ceiling is what makes it decline one, leaving dnf5 to the DNF5 subclass that drives it properly. Without it the two managers would report the same RPM database twice.

cli_names: tuple[str, ...] = ('dnf', 'dnf4')¶

dnf4 is the fallback for a host that renamed the dnf4 binary.

It stays after dnf deliberately. On RHEL 8 and 9 the only name is dnf, which is dnf4; on Fedora both exist, and reaching the vestigial /usr/bin/dnf4 there would report a second view of the database dnf5 already covers.

pre_args: tuple[str, ...] = ('--color=never', '--quiet')¶
version_regexes: tuple[str, ...] = ('dnf5\\s+version\\s+(?P<version>\\S+)', '(?P<version>\\S+)')¶

dnf4 prints a bare version, so the first pattern is for the other binary.

A dnf that is really dnf5 opens dnf5 version 5.4.3.0, whose first token is the word dnf5. Matching that first is what lets the requirement ceiling above refuse it by version rather than by a parse accident: the bare fallback alone would read dnf5 as the version and report that back to the user.

$ dnf --version
4.24.0
  Installed: rpm-0:6.0.2-1.fc44.aarch64 at Fri 04 Sep 2026 08:23:20 AM GMT
  Built    : Fedora Project at Thu 16 Jul 2026 04:13:23 PM GMT
DELIMITER = '___MPM___'¶
property installed: Iterator[Package]¶

Fetch installed packages.

$ dnf --color=never --quiet repoquery --userinstalled --qf {format}
NetworkManager-bluetooth___MPM___1.56.1___MPM___Bluetooth device plugin for NetworkManager___MPM___aarch64
NetworkManager-team___MPM___1.56.1___MPM___Team device plugin for NetworkManager___MPM___aarch64
NetworkManager-wifi___MPM___1.56.1___MPM___Wifi plugin for NetworkManager___MPM___aarch64

%{version} is the upstream version alone: the first of those three is installed as 1:1.56.1-2.fc44, and neither its epoch nor its release reaches this listing. outdated below reports %{evr} instead, which carries both.

property outdated: Iterator[Package]¶

Fetch outdated packages.

Two queries, because one cannot answer both halves. --upgrades restricts the query to available packages, so every field it returns describes the upgrade candidate and none of them the installed package. repoquery exposes no tag for the latter either, --querytags listing epoch, evr, release and version for whichever package matched. So the installed side is read once, up front, and joined on name and architecture: the pair is what identifies a package on a multilib host, where the same name is installed for two of them.

Both sides are reported as %{evr}, the epoch-version-release triplet RPM actually orders packages by. A bare %{version} would hide the release, and a release-only rebuild (1.21.0-1.fc44 to 1.21.0-2.fc44) is a real upgrade that would then read as an identical version on both sides. This is the one operation where that matters, which is why installed above still reports %{version}: changing it would rewrite the version string every snapshot carries.

One format serves both, the summary going unread on the installed pass. That keeps the two outputs the same shape, which is what lets either block stand in for the other when a documented FORMAT placeholder leaves the two calls indistinguishable.

$ dnf --color=never --quiet repoquery --installed --qf {format}
librepo___MPM___1.21.0-1.fc44___MPM___Repodata downloading library___MPM___aarch64
openldap___MPM___2.6.13-1.fc44___MPM___LDAP support libraries___MPM___aarch64
wireless-regdb___MPM___2026.05.30-1.fc44___MPM___Regulatory database for 802.11 wireless networking___MPM___noarch
$ dnf --color=never --quiet repoquery --upgrades --qf {format}
librepo___MPM___1.21.0-2.fc44___MPM___Repodata downloading library___MPM___aarch64
openldap___MPM___2.6.14-1.fc44___MPM___LDAP support libraries___MPM___aarch64
wireless-regdb___MPM___2026.09.03-1.fc44___MPM___Regulatory database for 802.11 wireless networking___MPM___noarch
property orphans: Iterator[Package]¶

Fetch packages installed as dependencies that nothing requires anymore.

$ dnf --color=never --quiet repoquery --unneeded
bc-0:1.08.2-4.fc44.aarch64
dos2unix-0:7.5.6-1.fc44.aarch64
tree-0:2.2.1-4.fc44.aarch64

A host reaches this state on its own, but rarely: a fresh install has nothing installed-as-a-dependency and then abandoned, which is why the rows above were made by marking three leaf packages with dnf mark dependency. That needs no network and is undone by dnf mark user.

search(query, extended, exact)[source]¶

Fetch matching packages.

Caution

Search does not support extended or exact matching. So we return the best subset of results and let meta_package_manager.manager.PackageManager.refiltered_search() refine them.

$ dnf4 --color=never --quiet search usd
========================== Name Exactly Matched: usd ===========================
usd.aarch64 : 3D VFX pipeline interchange file format
========================= Name & Summary Matched: usd ==========================
libbpf-usdt-devel.noarch : The header for defining USDTs
python3-usd.aarch64 : Development files for USD
usd-devel.aarch64 : Development files for USD
============================== Name Matched: usd ===============================
busd.aarch64 : D-Bus bus (broker) implementation
lvm2-dbusd.noarch : LVM2 D-Bus daemon
rust-busd+default-devel.noarch : D-Bus bus (broker) implementation
rust-busd+tracing-subscriber-devel.noarch : D-Bus bus (broker) implementation
rust-busd-devel.noarch : D-Bus bus (broker) implementation
usd-libs.aarch64 : Universal Scene Description library

dnf5 answers in its own shape, which yum also produces wherever that name points at dnf5:

$ dnf --color=never --quiet search bash
Matched fields: name (exact)
 bash.aarch64   The GNU Bourne Again shell
Matched fields: name, summary
 argbash.noarch Bash argument parsing code generator
 bash-argsparse.noarch  An high level argument parsing library for bash
Return type:

Iterator[Package]

install(package_id, version=None)[source]¶

Install one package.

$ sudo dnf --color=never --quiet --assumeyes install pip
Return type:

str

mark_explicit(package_id)[source]¶

Mark an installed package as installed by the user.

dnf install only logs a package that is already installed, and keeps its dependency reason: base.py.

$ sudo dnf --color=never --quiet mark install pip
Return type:

str

upgrade_all_cli()[source]¶

Generates the CLI to upgrade all outdated packages.

$ sudo dnf --color=never --quiet --assumeyes upgrade
Return type:

tuple[str, ...]

upgrade_one_cli(package_id, version=None)[source]¶

Generates the CLI to upgrade the provided package.

$ sudo dnf --color=never --quiet --assumeyes upgrade pip
Return type:

tuple[str, ...]

remove(package_id)[source]¶

Remove one package and one only.

$ sudo dnf --color=never --quiet --assumeyes remove pip
Return type:

str

remove_orphan(package_id)[source]¶

Remove one package, dropping dependencies it alone pulled in.

autoremove targets the package plus the dependencies that were installed to satisfy it and are no longer required by anything else.

$ sudo dnf --color=never --quiet --assumeyes autoremove pip
Return type:

str

sync()[source]¶

Sync package metadata.

$ dnf --color=never --quiet check-update
Return type:

None

cleanup_orphan()[source]¶

Remove every package installed as a dependency and no longer required.

$ sudo dnf --color=never --quiet --assumeyes autoremove
Return type:

None

cleanup_cache()[source]¶

Clear the cached packages and repository metadata.

$ sudo dnf --color=never --quiet clean all
Return type:

None

doctor_cli()[source]¶

Generates the CLI running the native self-diagnosis.

check examines the rpm database for problems (duplicates, obsoleted packages, unsatisfied dependencies) and exits non-zero when any is found.

$ dnf --color=never --quiet check
Return type:

tuple[str, ...]

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_url names on its own, and when it is the project’s manual, which documentation_url names. Never inherited, like the other links.

id: str = 'dnf'¶

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.

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.

class meta_package_manager.managers.dnf.DNF5[source]¶

Bases: DNF

The dnf5 rewrite of DNF, Fedora’s reference package manager since Fedora 41.

Inherits every operation and parser from DNF. Its forced arguments drop --color=never (dnf5 rejects that option), keeping only --quiet.

Initialize cli_errors list.

maintenance_note: str | None = None¶

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 with unmaintained: a confirmed-dead manager carries an unmaintained_message instead. Enforced by test_maintenance_note.

name: str = 'Fedora DNF5'¶

Return package manager’s common name.

Default value is based on class name.

documentation_url: str | None = 'https://dnf5.readthedocs.io/en/latest/'¶

Entry point of the project’s own documentation, or None when it has none.

The manual, the documentation site, or the man page of the CLI mpm drives: whichever page a user reads to learn the commands this manager wraps. Listed between homepage_url and repository_url in the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.

Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README repository_url already reaches. A page about the ecosystem rather than the tool does not qualify either.

Where a project’s only site is its manual, that address belongs here and homepage_url stays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.

Never inherited, like every other link: the AUR helpers extending pacman each document themselves.

repository_url: str | None = 'https://github.com/rpm-software-management/dnf5'¶

Repository holding the project’s code, or None when it has no public one.

Linked from the manager’s documentation page. Also what the weekly metrics sample reads: docs/docs_update.py writes it into the [tool.repomatic.metrics] subjects of pyproject.toml when 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 extending pacman each live in a repository of their own.

wikipedia_url: str | None = 'https://en.wikipedia.org/wiki/DNF_(software)'¶

English Wikipedia article about the project, or None when it has none.

Listed last in 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: lazy is a Neovim plugin manager, and the Neovim article is not about it.

Never inherited: the metaclass resets it to None on any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extending pacman, and would otherwise present pacman’s article as its own. Documentation-only, like homepage_url.

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 in docs/assets/managers/logos.yaml. Inlined at the top of the manager’s page by meta_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 (brew and cask) or because the tool has no mark of its own and its ecosystem’s stands in (apt under Debian’s swirl, cargo under Rust’s gear). Documentation-only, like homepage_url: no CLI output reads it.

requirement: str | None = '>=5.0.0'¶

dnf5 is the new reference package manager as of Fedora 41.

cli_names: tuple[str, ...] = ('dnf5',)¶

dnf4 is the fallback for a host that renamed the dnf4 binary.

It stays after dnf deliberately. On RHEL 8 and 9 the only name is dnf, which is dnf4; on Fedora both exist, and reaching the vestigial /usr/bin/dnf4 there would report a second view of the database dnf5 already covers.

pre_args: tuple[str, ...] = ('--quiet',)¶

Reset global options inherited from the DNF above.

Kept for the dnf5 releases that rejected --color=never. Current ones accept it: 5.4.3.0 exits 0 on the option, where an unknown one exits 2.

version_regexes: tuple[str, ...] = ('dnf5\\s+version\\s+(?P<version>\\S+)',)¶

dnf5 opens its own name, where dnf4 answers with a bare version.

The bare (?P<version>\S+) default would read that first token as the version itself, and the manager would then refuse its own requirement, taking Fedora’s reference package manager out of the pool entirely.

$ dnf5 --version
dnf5 version 5.4.3.0
dnf5 plugin API version 2.0
libdnf5 version 5.4.3.0
libdnf5 plugin API version 2.2
mark_explicit(package_id)[source]¶

Mark an installed package as installed by the user.

dnf5 renamed the verb: its mark takes user where dnf4 takes install. dnf5 install changes the reason of an installed package only when rpm installed it outside dnf: goal.cpp.

$ sudo dnf5 --quiet mark user pip
Return type:

str

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_url names on its own, and when it is the project’s manual, which documentation_url names. Never inherited, like the other links.

id: str = 'dnf5'¶

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.

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.

class meta_package_manager.managers.dnf.YUM[source]¶

Bases: DNF

YUM, the package manager DNF superseded.

On current Fedora and RHEL the yum binary is a wrapper around dnf. mpm drives it exactly as DNF, only the binary name differs.

Initialize cli_errors list.

maintenance_note: str | None = 'The standalone [yum project is archived](https://github.com/rpm-software-management/yum); on modern RHEL and Fedora the `yum` command is a maintained compatibility alias for [dnf](https://github.com/rpm-software-management/dnf).'¶

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 with unmaintained: a confirmed-dead manager carries an unmaintained_message instead. Enforced by test_maintenance_note.

name: str = 'Fedora YUM'¶

Return package manager’s common name.

Default value is based on class name.

homepage_url: str | None = 'http://yum.baseurl.org'¶

Home page of the project, only used in documentation for reference.

Left unset when the home page is the project’s repository, which repository_url names on its own, and when it is the project’s manual, which documentation_url names. Never inherited, like the other links.

id: str = 'yum'¶

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.

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.

documentation_url: str | None = 'https://man7.org/linux/man-pages/man8/yum.8.html'¶

Entry point of the project’s own documentation, or None when it has none.

The manual, the documentation site, or the man page of the CLI mpm drives: whichever page a user reads to learn the commands this manager wraps. Listed between homepage_url and repository_url in the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.

Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README repository_url already reaches. A page about the ecosystem rather than the tool does not qualify either.

Where a project’s only site is its manual, that address belongs here and homepage_url stays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.

Never inherited, like every other link: the AUR helpers extending pacman each document themselves.

repository_url: str | None = 'https://github.com/rpm-software-management/yum'¶

Repository holding the project’s code, or None when it has no public one.

Linked from the manager’s documentation page. Also what the weekly metrics sample reads: docs/docs_update.py writes it into the [tool.repomatic.metrics] subjects of pyproject.toml when 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 extending pacman each live in a repository of their own.

wikipedia_url: str | None = 'https://en.wikipedia.org/wiki/Yum_(software)'¶

English Wikipedia article about the project, or None when it has none.

Listed last in 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: lazy is a Neovim plugin manager, and the Neovim article is not about it.

Never inherited: the metaclass resets it to None on any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extending pacman, and would otherwise present pacman’s article as its own. Documentation-only, like homepage_url.

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 in docs/assets/managers/logos.yaml. Inlined at the top of the manager’s page by meta_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 (brew and cask) or because the tool has no mark of its own and its ecosystem’s stands in (apt under Debian’s swirl, cargo under Rust’s gear). Documentation-only, like homepage_url: no CLI output reads it.

requirement: str | None = '>=4.0.0'¶

No ceiling, unlike the DNF parent.

yum is a compatibility name rather than a generation: it fronts dnf4 on RHEL 8 and 9, and dnf5 on Fedora 41 and later. Both are the manager this class is for, so it accepts either, and the inherited version_regexes already read both shapes.

cli_names: tuple[str, ...] = ('yum',)¶

dnf4 is the fallback for a host that renamed the dnf4 binary.

It stays after dnf deliberately. On RHEL 8 and 9 the only name is dnf, which is dnf4; on Fedora both exist, and reaching the vestigial /usr/bin/dnf4 there would report a second view of the database dnf5 already covers.

mark_explicit(package_id)[source]¶

Mark an installed package as installed by the user.

The mark verb follows the dnf generation behind yum: install on dnf4, user on dnf5 (see DNF5.mark_explicit()).

$ sudo yum --color=never --quiet mark install pip
$ sudo yum --color=never --quiet mark user pip
Return type:

str