dnf module manages packages and repositories on Fedora and RHEL 8+ systems using the dnf package manager.
Dnf package names are case-sensitive.
Functions
packages
Install, remove, or update dnf packages.str | list[str]
List of packages to ensure.
bool
default:true
Whether the packages should be installed.
bool
default:false
Whether to upgrade packages without a specified version.
bool
default:false
Run
dnf update before installing packages.bool
default:false
Run
dnf clean before installing packages.bool
default:false
Add the —nobest option to install.
str
Additional arguments to the dnf install command.
str
Additional arguments to the dnf uninstall command.
Package versions can be pinned as:
<pkg>=<version>Examples
update
Update all dnf packages.repo
Add, remove, or update dnf repositories.str
required
URL or name for the
.repo file.bool
default:true
Whether the
.repo file should be present.str
The baseurl of the repo (if
src is not a URL).str
Optional verbose description.
bool
default:true
Whether this repo is enabled.
bool
default:true
Whether to set
gpgcheck=1.str
The URL to the GPG key for this repo.
baseurl, description, gpgcheck, and gpgkey are only valid when src is a filename (not a URL). Use a URL to download and install remote repository files.Examples
rpm
Install or remove .rpm package files.str
required
Filename or URL of the
.rpm package.bool
default:true
Whether the package should exist on the system.
key
Add dnf GPG keys with rpm.str
required
Filename or URL of the GPG key.
