dnf

Module Contents

class dnf.Repo

Bases: tuple

name
baseurl
data
file
dnf.repo_configs()

Yield tuples of (name,dict) of all enabled repositories on the host, where ‘dict’ represents repository .conf contents.

dnf.repo_urls()

Yield tuples of (name,baseurl) of all enabled repositories on the host.

dnf.repo_files()

Yield Paths of all enabled repository files (yum.repos.d) on the host.

dnf.installable_url()

Return one baseurl usable for installing the currently-running system.

dnf.download_rpm(nvr, source=False)

Downloads a single RPM by its NVR (which can be just name or any other version/release string accepted by DNF) and yields the result as a temporary file path.

‘source’ specifies whether to download a binary or a source RPM.

dnf.extract_rpm(rpmfile)

Extracts a binary or source RPM using rpm2cpio into a temporary directory, yielding a path to that directory.