libdnf5.rpm

class libdnf5.rpm.Changelog(*args)
get_author()
get_text()
get_timestamp()
thisown
class libdnf5.rpm.Checksum(*args)

Class contains checksum and checksum type

Type_MD5
Type_SHA1
Type_SHA224
Type_SHA256
Type_SHA384
Type_SHA512
Type_UNKNOWN
get_checksum()

Return checksum in hex format

get_type()
get_type_str()
thisown
class libdnf5.rpm.KeyInfo(*args)
get_fingerprint()
get_key_id()
get_path()
get_raw_key()
get_short_key_id()
get_timestamp()
get_url()
get_user_ids()
thisown
class libdnf5.rpm.Nevra(*args)
Form_NA
Form_NAME
Form_NEV
Form_NEVR
Form_NEVRA
clear()

Returns false when parsing failed and stored data are in inconsistency state.

get_arch()
static get_default_pkg_spec_forms()

The default forms and their order determine pkg_spec matching

get_epoch()
get_name()
get_release()
get_version()
has_just_name()
static parse(*args)

Overload 1: Parse string into Nevra struct :type nevra_str: string :param nevra_str: String to parse :rtype: std::vector< libdnf5::rpm::Nevra,std::allocator< libdnf5::rpm::Nevra > > :return: Vector with parsed Nevra :raises: IncorrectNevraString Since: - 1.0.0


Overload 2: Parse string into Nevra struct using given forms :type nevra_str: string :param nevra_str: String to parse :type forms: std::vector< libdnf5::rpm::Nevra::Form,std::allocator< libdnf5::rpm::Nevra::Form > > :param forms: Allowed forms used for parsing :rtype: std::vector< libdnf5::rpm::Nevra,std::allocator< libdnf5::rpm::Nevra > > :return: Vector with parsed Nevra :raises: IncorrectNevraString

set_arch(*args)
set_epoch(*args)
set_name(*args)
set_release(*args)
set_version(*args)
thisown
class libdnf5.rpm.Package(*args)
get_arch()
Return type:

string

Returns:

RPM package Arch (RPMTAG_ARCH).

Since: 5.0

get_base()
Return type:

libdnf5::BaseWeakPtr

Returns:

The Base object to which this object belongs.

Since: 5.0.5

get_baseurl()
Return type:

string

Returns:

RPM package baseurl from repodata (<location xml:base=”…”>).

Since: 5.0

get_build_time()
Return type:

int

Returns:

RPM package build timestamp (RPMTAG_BUILDTIME).

Since: 5.0

get_changelogs()
Return type:

std::vector< libdnf5::rpm::Changelog,std::allocator< libdnf5::rpm::Changelog > >

Returns:

List of package changelog entries. If other repository metadata are

Since: 5.0

get_checksum()
Return type:

Checksum

Returns:

Checksum object representing RPM package checksum and its type (<checksum type=”type”>checksum<checksum>).

Since: 5.0

get_conflicts()
Return type:

ReldepList

Returns:

List of RPM package Conflicts (RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTFLAGS, RPMTAG_CONFLICTVERSION).

Since: 5.0

get_debuginfo_name()
Return type:

string

Returns:

name of the debuginfo package for this package. If this package is a debuginfo package, return its name. If this package is a debugsource package, returns the debuginfo package for the base package. E.g. kernel-PAE -> kernel-PAE-debuginfo

Since: 5.0.10

get_debuginfo_name_of_source()
Return type:

string

Returns:

name of the debuginfo package for source package of this package. E.g. krb5-libs -> krb5-debuginfo

Since: 5.0.10

get_debugsource_name()
Return type:

string

Returns:

name of the debugsource package for this package E.g. krb5-libs -> krb5-debugsource

Since: 5.0.10

get_depends()
Return type:

ReldepList

Returns:

List of RPM package dependencies (requires + enhances + suggests + supplements + recommends).

Since: 5.0.10

get_description()
Return type:

string

Returns:

RPM package Description (RPMTAG_DESCRIPTION).

Since: 5.0

get_download_size()
Return type:

int

Returns:

File size of the RPM package.

Since: 5.0

get_enhances()
Return type:

ReldepList

Returns:

List of RPM package Enhances (RPMTAG_ENHANCENAME, RPMTAG_ENHANCEFLAGS, RPMTAG_ENHANCEVERSION).

Since: 5.0

get_epoch()
Return type:

string

Returns:

RPM package Epoch (RPMTAG_EPOCH).

Since: 5.0

get_evr()
Return type:

string

Returns:

RPM package EVR (Epoch:Version-Release). If the Epoch is 0, it is omitted from the output.

Since: 5.0

get_files()
Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

List of files and directories the RPM package contains (RPMTAG_FILENAMES). If file lists are not loaded, empty list is returned.

Since: 5.0 Notes: Information whether the returned files are actual files, directories or ghosted files is not available.

get_from_repo_id()

TODO is_local For an installed package, return id of repo from the package was installed. For an available package, return an empty string.

get_full_nevra()
Return type:

string

Returns:

RPM package NEVRA (Name-Epoch:Version-Release.Arch). The Epoch is always present even if it is 0.

Since: 5.0

get_group()
Return type:

string

Returns:

RPM package Group (RPMTAG_GROUP).

Since: 5.0

get_hash()

Return unique ID representing Package

get_hdr_checksum()
Return type:

Checksum

Returns:

Checksum object representing RPM package header checksum and its type.

Since: 5.0

get_hdr_end()
Return type:

int

Returns:

RPM package header end (the header is located between file position 0 and the returned offset).

Since: 5.0

get_id()
get_install_size()
Return type:

int

Returns:

Size the RPM package should occupy after installing on disk (RPMTAG_LONGSIZE). The information is always present - it is retrieved from rpmdb if the package is installed or from repodata if the package is available.

Since: 5.0 Notes: The actual size on disk may vary based on block size and filesystem overhead.

Libdnf doesn’t provide any method to compute the actual size on disk.

get_install_time()
Return type:

int

Returns:

The unix timestamp (seconds since epoch) of when the package was installed. Return 0 if the package is not installed.

get_license()
Return type:

string

Returns:

RPM package License (RPMTAG_LICENSE).

Since: 5.0

get_location()
Return type:

string

Returns:

RPM package relative path/location from repodata (<location href=”…”>).

Since: 5.0

get_media_number()
Return type:

int

Returns:

Number of media (usually a CD/DVD disc) on which the package is located.

Since: 5.0

get_na()
Return type:

string

Returns:

RPM package NA (Name.Arch).

Since: 5.0

get_name()
Return type:

string

Returns:

RPM package Name (RPMTAG_NAME).

Since: 5.0

get_nevra()
Return type:

string

Returns:

RPM package NEVRA (Name-Epoch:Version-Release.Arch). If the Epoch is 0, it is omitted from the output.

Since: 5.0

get_obsoletes()
Return type:

ReldepList

Returns:

List of RPM package Obsoletes (RPMTAG_OBSOLETENAME, RPMTAG_OBSOLETEFLAGS, RPMTAG_OBSOLETEVERSION).

Since: 5.0

get_package_path()
Return type:

string

Returns:

Path to the RPM package on the local file system: If the package is a local package, return its path If the package is a remote package downloaded to cache, return path to the cache If the package is a remote package that hasn’t been downloaded yet, return path to the cache

Since: 5.0

get_packager()
Return type:

string

Returns:

RPM package Packager (RPMTAG_PACKAGER).

Since: 5.0

get_prereq_ignoreinst()
get_provides()
Return type:

ReldepList

Returns:

List of RPM package Provides (RPMTAG_PROVIDENAME, RPMTAG_PROVIDEFLAGS, RPMTAG_PROVIDEVERSION).

Since: 5.0

get_reason()
Return type:

int

Returns:

Resolved reason why a package was installed. A package can be installed due to multiple reasons, only the most significant is returned.

Since: 5.0

get_recommends()
Return type:

ReldepList

Returns:

List of RPM package Recommends (RPMTAG_RECOMMENDNAME, RPMTAG_RECOMMENDFLAGS, RPMTAG_RECOMMENDVERSION).

Since: 5.0

get_regular_requires()
get_release()
Return type:

string

Returns:

RPM package Release (RPMTAG_RELEASE).

Since: 5.0

get_remote_locations(*args)
Return type:

std::vector< std::string,std::allocator< std::string > >

Returns:

RPM package remote location where the package can be download from. Returns empty vector for installed and commandline packages.

Since: 5.1

get_repo()
Return type:

RepoWeakPtr

Returns:

A Repo object that represents the repository the package belongs to.

Since: 5.0 Notes: This isn’t the repository the package was installed from.

get_repo_id()
Return type:

string

Returns:

Id of the repository the package belongs to.

Since: 5.0 Notes: This isn’t the repository the package was installed from.

get_repo_name()
Return type:

string

Returns:

Name of the repository the package belongs to.

Since: 5.0.10 Notes: This isn’t the repository the package was installed from.

get_requires()
Return type:

ReldepList

Returns:

List of RPM package Requires (RPMTAG_REQUIRENAME, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIREVERSION).

Since: 5.0

get_requires_pre()
Return type:

ReldepList

Returns:

List of RPM package Requires(pre).

Since: 5.0

get_rpmdbid()
Return type:

int

Returns:

The rpmdb database id (primary key) of the installed RPM package.

Since: 5.0

get_source_name()
Return type:

string

Returns:

RPM package source name.

Since: 5.0

get_sourcerpm()
Return type:

string

Returns:

RPM package source package filename (RPMTAG_SOURCERPM).

Since: 5.0

get_suggests()
Return type:

ReldepList

Returns:

List of RPM package Suggests (RPMTAG_SUGGESTNAME, RPMTAG_SUGGESTFLAGS, RPMTAG_SUGGESTVERSION).

Since: 5.0

get_summary()
Return type:

string

Returns:

RPM package Summary (RPMTAG_SUMMARY).

Since: 5.0

get_supplements()
Return type:

ReldepList

Returns:

List of RPM package Supplements (RPMTAG_SUPPLEMENTNAME, RPMTAG_SUPPLEMENTFLAGS, RPMTAG_SUPPLEMENTVERSION).

Since: 5.0

get_url()
Return type:

string

Returns:

RPM package URL (project home address) (RPMTAG_URL).

Since: 5.0

get_vendor()
Return type:

string

Returns:

RPM package Vendor (RPMTAG_VENDOR).

Since: 5.0

get_version()
Return type:

string

Returns:

RPM package Version (RPMTAG_VERSION).

Since: 5.0

is_available_locally()
Return type:

boolean

Returns:

true if the package is available locally, false otherwise.

Since: 5.0.8

is_excluded()
Return type:

boolean

Returns:

true if the package is excluded, false otherwise.

Since: 5.0

is_installed()
Return type:

boolean

Returns:

true if the package is installed on the system, false otherwise.

Since: 5.0

thisown
to_string()

Return NEVRA -> 0 epoch is not shown in string

to_string_description()

Provide descriptive information about instance including NEVRA and ID

class libdnf5.rpm.PackageId(*args)
id
thisown
class libdnf5.rpm.PackageQuery(*args)
filter_advisories(*args)

Filter packages by advisories they are included in.

Parameters:
  • advisory_query (libdnf5::advisory::AdvisoryQuery) – AdvisoryQuery with Advisories that contain package lists the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.0

filter_arch(*args)

Overload 1: Filter packages by their arch.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 2: Filter packages by their arch.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 3: Filter packages by their arch.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0

filter_available()

Filter available packages.

Removes from the query all packages that are installed. Since: 5.0

filter_conflicts(*args)

Overload 1: Filter packages by their conflicts.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their conflicts.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their conflicts.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their conflicts.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their conflicts.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their conflicts.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their conflicts.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_description(*args)

Overload 1: Filter packages by their description.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.2


Overload 2: Filter packages by their description.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 3: Filter packages by their description.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0

filter_downgradable()

Filter installed packages for which there are available downgrades.

Only installed packages remain in the query, and only those for which downgrades are available. Since: 5.0

filter_downgrades()

Filter available packages that are downgrades to installed packages.

Removes from the query all packages that are not downgrades to installed packages. Since: 5.0

filter_duplicates()

Filter packages to keep only duplicates of installed packages. Packages are duplicate if they have the same name and arch but different evr.

filter_earliest_evr(limit=1)

Group packages by name and arch. Then within each group, keep packages that correspond with up to limit of (all but) earliest `evr`s in the group.

Parameters:

limit (int, optional) – If limit > 0, keep limit number evr`s in each group. If `limit < 0, keep all but limit last `evr`s in each group.

Since: 5.0

filter_earliest_evr_any_arch(limit=1)

Group packages by name. Then within each group, keep packages that correspond with up to limit of (all but) earliest `evr`s in the group.

Parameters:

limit (int, optional) – If limit > 0, keep limit number evr`s in each group. If `limit < 0, keep all but limit last `evr`s in each group.

Since: 5.2

filter_enhances(*args)

Overload 1: Filter packages by their enhances.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their enhances.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their enhances.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their enhances.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their enhances.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their enhances.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their enhances.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_epoch(*args)

Overload 1: Filter packages by their epoch.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 2: Filter packages by their epoch.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 3: Filter packages by their epoch.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 4: Filter packages by their epoch.

Parameters:
  • pattern (int) – A number the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.2


Overload 5: Filter packages by their epoch.

Parameters:
  • pattern (int) – A number the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.2


Overload 6: Filter packages by their epoch.

Parameters:
  • patterns (std::vector< unsigned long,std::allocator< unsigned long > >) – A vector of numbers the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.0


Overload 7: Filter packages by their epoch.

Parameters:
  • patterns (std::vector< unsigned long,std::allocator< unsigned long > >) – A vector of numbers the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.0

filter_evr(*args)

Overload 1: Filter packages by their epoch:version-release.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, GT, LT, GTE, LTE, EQ.

Since: 5.2


Overload 2: Filter packages by their epoch:version-release.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, GT, LT, GTE, LTE, NEQ.

Since: 5.0


Overload 3: Filter packages by their epoch:version-release.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, GT, LT, GTE, LTE, NEQ.

Since: 5.0

filter_extras(exact_evr=False)

Keep in the query only packages that are installed but not available in any enabled repository. Even excluded packages (e.g. using excludepkgs config option) are considered as available in repositories for the purpose of extras calculation. Those installed packages that are only part of non-active modules are also considered as extras. :type exact_evr: boolean, optional :param exact_evr: If false (default) extras calculation is based only on

name.arch. That means package is not in extras if any version of the package exists in any of the enabled repositories. If true, filter_extras is more strict and returns each package which exact NEVRA is not present in any enabled repository.

filter_file(*args)

Overload 1: Filter packages by files they contain.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.2


Overload 2: Filter packages by files they contain.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 3: Filter packages by files they contain.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0

filter_installed()

Filter installed packages.

Removes from the query all packages that are not installed. Since: 5.0

filter_installonly()

Filter installonly packages.

Filter packages that provide a capability that matches with any value in installonlypkgs configuration option.

filter_latest_evr(limit=1)

Group packages by name and arch. Then within each group, keep packages that correspond with up to limit of (all but) latest `evr`s in the group.

Parameters:

limit (int, optional) – If limit > 0, keep limit number evr`s in each group. If `limit < 0, keep all but limit last `evr`s in each group.

Since: 5.0

filter_latest_evr_any_arch(limit=1)

Group packages by name. Then within each group, keep packages that correspond with up to limit of (all but) latest `evr`s in the group.

Parameters:

limit (int, optional) – If limit > 0, keep limit number evr`s in each group. If `limit < 0, keep all but limit last `evr`s in each group.

Since: 5.2

filter_latest_unresolved_advisories(*args)

Filter packages by the advisories they are included in, considering only the latest advisories that are not resolved in the currently installed package set.

Parameters:
  • advisory_query (libdnf5::advisory::AdvisoryQuery) – AdvisoryQuery with Advisories that contain package lists the filter is matched against.

  • installed (PackageQuery) – PackageQuery with currently installed packages.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE.

Since: 5.0

filter_leaves()

Filter the leaf packages.

Leaf packages are installed packages that are not required as a dependency of another installed package. However, two or more installed packages might depend on each other in a dependency cycle. Packages in such cycles that are not required by any other installed package are also leaf.

filter_leaves_groups()

Filter the leaf packages and return them grouped by their dependencies.

Leaf packages are installed packages that are not required as a dependency of another installed package. However, two or more installed packages might depend on each other in a dependency cycle. Packages in such cycles that are not required by any other installed package are also leaf. Packages in such cycles form a group of leaf packages.

Return type:

std::vector< std::vector< libdnf5::rpm::Package,std::allocator< libdnf5::rpm::Package > >,std::allocator< std::vector< libdnf5::rpm::Package,std::allocator< libdnf5::rpm::Package > > > >

Returns:

Groups of one or more interdependent leaf packages.

filter_location(*args)

Overload 1: Filter packages by their location. :type pattern: string :param pattern: A string the filter is matched against. :type cmp_type: int, optional :param cmp_type: A comparison (match) operator, defaults to QueryCmp::EQ.

Supported values: EQ, NEQ.

Since: 5.2


Overload 2: Filter packages by their location. :type patterns: std::vector< std::string,std::allocator< std::string > > :param patterns: A vector of strings the filter is matched against. :type cmp_type: int, optional :param cmp_type: A comparison (match) operator, defaults to QueryCmp::EQ.

Supported values: EQ, NEQ.

Since: 5.0


Overload 3: Filter packages by their location. :type patterns: std::vector< std::string,std::allocator< std::string > > :param patterns: A vector of strings the filter is matched against. :param cmp_type: A comparison (match) operator, defaults to QueryCmp::EQ.

Supported values: EQ, NEQ.

Since: 5.0

filter_name(*args)

Overload 1: Filter packages by their name.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 2: Filter packages by their name.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 3: Filter packages by their name.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 4: Filter packages by their name based on names of the packages in the package_set.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 5: Filter packages by their name based on names of the packages in the package_set.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_name_arch(*args)

Filter packages by their name and arch based on names and arches of the packages in the package_set.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_nevra(*args)

Overload 1: Filter packages by their name-[epoch:]version-release.arch. The following matches are tolerant to omitted 0 epoch: EQ, NEQ, GT, GTE, LT, LTE.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB, IGLOB, NOT_IGLOB, IEXACT, NOT_IEXACT.

Since: 5.2


Overload 2: Filter packages by their name-[epoch:]version-release.arch. The following matches are tolerant to omitted 0 epoch: EQ, NEQ, GT, GTE, LT, LTE.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB, IGLOB, NOT_IGLOB, IEXACT, NOT_IEXACT.

Since: 5.0


Overload 3: Filter packages by their name-[epoch:]version-release.arch. The following matches are tolerant to omitted 0 epoch: EQ, NEQ, GT, GTE, LT, LTE.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB, IGLOB, NOT_IGLOB, IEXACT, NOT_IEXACT.

Since: 5.0


Overload 4: Filter packages by the name, epoch, version, release and arch attributes from the nevra object. Only the attributes that are not blank are used in the filter.

Parameters:
  • nevra (Nevra) – A Nevra object the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, IGLOB, NOT_IGLOB.

Since: 5.0


Overload 5: Filter packages by the name, epoch, version, release and arch attributes from the nevra object. Only the attributes that are not blank are used in the filter.

Parameters:
  • nevra (Nevra) – A Nevra object the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, IGLOB, NOT_IGLOB.

Since: 5.0


Overload 6: Filter packages by their name-[epoch:]version-release.arch attributes of the packages in the package_set. Only packages whose name.arch is present in the package_set are taken into account. Their epoch:version-release are then compared according to the value of cmp_type with those in package_set. Only the matching packages are kept in the query. In case NOT is used in cmp_type, the matching packages are removed from the query.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, and their combinations with NOT.

Since: 5.0


Overload 7: Filter packages by their name-[epoch:]version-release.arch attributes of the packages in the package_set. Only packages whose name.arch is present in the package_set are taken into account. Their epoch:version-release are then compared according to the value of cmp_type with those in package_set. Only the matching packages are kept in the query. In case NOT is used in cmp_type, the matching packages are removed from the query.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, and their combinations with NOT.

Since: 5.0

filter_obsoletes(*args)

Overload 1: Filter packages by their obsoletes.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their obsoletes.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their obsoletes.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their obsoletes.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their obsoletes.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their obsoletes.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 7: Filter packages by their obsoletes.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0

filter_priority()

Group packages by name and arch. Then within each group, keep packages that belong to a repo with the highest priority (the lowest number). The filter works only on available packages, installed packages are not affected.

Since: 5.0

filter_provides(*args)

Overload 1: Filter packages by their provides.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their provides.

Parameters:
  • reldep (Reldep) – RelDep object the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 3: Filter packages by their provides.

Parameters:
  • reldep (Reldep) – RelDep object the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 4: Filter packages by their provides.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 5: Filter packages by their provides.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 6: Filter packages by their provides.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 7: Filter packages by their provides.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0

filter_reboot_suggested()

Filter packages whose installation or upgrade should cause a system reboot to be recommended. These are packages that either (1) belong to a hardcoded set of “core packages”, including the kernel and systemd, or (2) have an associated reboot_suggested advisory.

filter_recent(timestamp)

Keep in the query only recent packages - those with build time after given timestamp :type timestamp: int :param timestamp: Only packages built after this will pass

filter_recommends(*args)

Overload 1: Filter packages by their recommends.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their recommends.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their recommends.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their recommends.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their recommends.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their recommends.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their recommends.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_release(*args)

Overload 1: Filter packages by their release.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.2


Overload 2: Filter packages by their release.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.0


Overload 3: Filter packages by their release.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.0

filter_repo_id(*args)

Overload 1: Filter packages by id of the Repo they belong to.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 2: Filter packages by id of the Repo they belong to.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 3: Filter packages by id of the Repo they belong to.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0

filter_requires(*args)

Overload 1: Filter packages by their requires.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their requires.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their requires.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their requires.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their requires.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their requires.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their requires.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_sourcerpm(*args)

Overload 1: Filter packages by their sourcerpm.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.


Overload 2: Filter packages by their sourcerpm.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.


Overload 3: Filter packages by their sourcerpm.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

filter_suggests(*args)

Overload 1: Filter packages by their suggests.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their suggests.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their suggests.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their suggests.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their suggests.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their suggests.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their suggests.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_summary(*args)

Overload 1: Filter packages by their summary.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.2


Overload 2: Filter packages by their summary.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 3: Filter packages by their summary.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0

filter_supplements(*args)

Overload 1: Filter packages by their supplements.

Parameters:
  • reldep_list (ReldepList) – ReldepList with RelDep objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 2: Filter packages by their supplements.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 3: Filter packages by their supplements.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.2


Overload 4: Filter packages by their supplements.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 5: Filter packages by their supplements.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB.

Since: 5.0


Overload 6: Filter packages by their supplements.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0


Overload 7: Filter packages by their supplements.

Parameters:
  • package_set (PackageSet) – PackageSet with Package objects the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ.

Since: 5.0

filter_unneeded()

Filter unneeded packages. Unneeded packages are those which are installed as dependencies and are not required by any user-installed package any more.

filter_upgradable()

Filter installed packages for which there are available upgrades.

Only installed packages remain in the query, and only those for which upgrades are available. Since: 5.0

filter_upgrades()

Filter available packages that are upgrades to installed packages.

Removes from the query all packages that are not upgrades to installed packages. Since: 5.0

filter_url(*args)

Overload 1: Filter packages by their url.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.2


Overload 2: Filter packages by their url.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0


Overload 3: Filter packages by their url.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GLOB, NOT_GLOB, IEXACT, NOT_IEXACT, ICONTAINS, NOT_ICONTAINS, IGLOB, NOT_IGLOB, CONTAINS, NOT_CONTAINS.

Since: 5.0

filter_userinstalled()

Keep in the query only installed packages that are user-installed.

filter_version(*args)

Overload 1: Filter packages by their version.

Parameters:
  • pattern (string) – A string the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.2


Overload 2: Filter packages by their version.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type (int, optional) – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.0


Overload 3: Filter packages by their version.

Parameters:
  • patterns (std::vector< std::string,std::allocator< std::string > >) – A vector of strings the filter is matched against.

  • cmp_type – A comparison (match) operator, defaults to QueryCmp::EQ. Supported values: EQ, NEQ, GT, GTE, LT, LTE, GLOB, NOT_GLOB.

Since: 5.0

filter_versionlock()

Filter out versionlock excluded packages.

The packages versions excluded by versionlock are removed from the query. Since: 5.1.13

resolve_pkg_spec(pkg_spec, settings, with_src)

Resolve spec according to provided settings. It tests whether spec is NEVRA type, provide, file or binary. It returns only the first match type. If spec has a match as NEVRA and provide type it only keeps matches with the first tested type (NEVRA).

swap(other)
thisown
class libdnf5.rpm.PackageSack(*args)
add_user_excludes(excludes)

Add package set to user excluded packages :type excludes: PackageSet :param excludes:: packages to add to excludes Since: 5.0

add_user_includes(includes)

Add package set to user included packages :type includes: PackageSet :param includes:: packages to add to includes Since: 5.0

add_versionlock_excludes(excludes)

Add package set to versionlock excluded packages :type excludes: PackageSet :param excludes:: packages to add to excludes Since: 5.1.13

clear_user_excludes()

Clear user excluded packages Since: 5.0

clear_user_includes()

Clear user included packages Since: 5.0

clear_versionlock_excludes()

Clear versionlock excluded packages Since: 5.1.13

get_base()
Return type:

libdnf5::BaseWeakPtr

Returns:

The Base object to which this object belongs.

Since: 5.0

get_nsolvables()

Returns number of solvables in pool.

get_running_kernel()
get_user_excludes()

Returns user excluded package set

get_user_includes()

Returns user included package set

get_versionlock_config()

Returns versionlock configuration Since: 5.1.13

get_versionlock_excludes()

Returns versionlock excluded package set Since: 5.1.13

get_weak_ptr()

Create WeakPtr to PackageSack

load_config_excludes_includes(only_main=False)

Loads excluded and included package sets from the configuration. Uses the disable_excludes, excludepkgs, and includepkgs configuration options for calculation. :type only_main: boolean, optional :param only_main: If true, the repository specific configurations are not used. Since: 5.0

remove_user_excludes(excludes)

Remove package set from user excluded packages :type excludes: PackageSet :param excludes:: packages to remove from excludes Since: 5.0

remove_user_includes(includes)

Remove package set from user included packages :type includes: PackageSet :param includes:: packages to remove from includes Since: 5.0

remove_versionlock_excludes(excludes)

Remove package set from versionlock excluded packages :type excludes: PackageSet :param excludes:: packages to remove from excludes Since: 5.1.13

set_user_excludes(excludes)

Resets user excluded packages to a new value :type excludes: PackageSet :param excludes:: packages to exclude Since: 5.0

set_user_includes(includes)

Resets user included packages to a new value :type includes: PackageSet :param includes:: packages to include Since: 5.0

set_versionlock_excludes(excludes)

Resets versionlock excluded packages to a new value :type excludes: PackageSet :param excludes:: packages to exclude Since: 5.1.13

thisown
class libdnf5.rpm.PackageSackWeakPtr(*args)

WeakPtr is a “smart” pointer. It contains a pointer to resource and to guard of resource. WeakPtr pointer can be owner of the resource. However, the resource itself may depend on another resource. WeakPtr registers/unregisters itself at the guard of resource. And the resource guard invalidates the registered WeakPtrs when the resource is unusable (eg. its dependecny was released). Note on thread safety: It is safe to create, access and destroy WeakPtrs in multiple threads simultaneously.

add_user_excludes(excludes)

Add package set to user excluded packages :type excludes: PackageSet :param excludes:: packages to add to excludes Since: 5.0

add_user_includes(includes)

Add package set to user included packages :type includes: PackageSet :param includes:: packages to add to includes Since: 5.0

add_versionlock_excludes(excludes)

Add package set to versionlock excluded packages :type excludes: PackageSet :param excludes:: packages to add to excludes Since: 5.1.13

clear_user_excludes()

Clear user excluded packages Since: 5.0

clear_user_includes()

Clear user included packages Since: 5.0

clear_versionlock_excludes()

Clear versionlock excluded packages Since: 5.1.13

get()

Returns a pointer to the managed object. Generates exception if object is not valid.

get_base()
Return type:

libdnf5::BaseWeakPtr

Returns:

The Base object to which this object belongs.

Since: 5.0

get_nsolvables()

Returns number of solvables in pool.

get_running_kernel()
get_user_excludes()

Returns user excluded package set

get_user_includes()

Returns user included package set

get_versionlock_config()

Returns versionlock configuration Since: 5.1.13

get_versionlock_excludes()

Returns versionlock excluded package set Since: 5.1.13

get_weak_ptr()

Create WeakPtr to PackageSack

has_same_guard(other)

Checks if the other WeakPtr instance has the same WeakPtrGuard.

is_valid()

Checks if managed object is valid.

load_config_excludes_includes(only_main=False)

Loads excluded and included package sets from the configuration. Uses the disable_excludes, excludepkgs, and includepkgs configuration options for calculation. :type only_main: boolean, optional :param only_main: If true, the repository specific configurations are not used. Since: 5.0

remove_user_excludes(excludes)

Remove package set from user excluded packages :type excludes: PackageSet :param excludes:: packages to remove from excludes Since: 5.0

remove_user_includes(includes)

Remove package set from user included packages :type includes: PackageSet :param includes:: packages to remove from includes Since: 5.0

remove_versionlock_excludes(excludes)

Remove package set from versionlock excluded packages :type excludes: PackageSet :param excludes:: packages to remove from excludes Since: 5.1.13

set_user_excludes(excludes)

Resets user excluded packages to a new value :type excludes: PackageSet :param excludes:: packages to exclude Since: 5.0

set_user_includes(includes)

Resets user included packages to a new value :type includes: PackageSet :param includes:: packages to include Since: 5.0

set_versionlock_excludes(excludes)

Resets versionlock excluded packages to a new value :type excludes: PackageSet :param excludes:: packages to exclude Since: 5.1.13

thisown
class libdnf5.rpm.PackageSet(*args)
add(pkg)

Add pkg to the set.

Parameters:

pkg (Package) – Package to be added to the set.

Since: 5.0

begin()
clear()

Remove all packages from the set.

Since: 5.0

contains(pkg)
Return type:

boolean

Returns:

true if a package is in the set, false otherwise.

Parameters:

pkg (Package) – Package that is tested for presence.

Since: 5.0

difference(other)

Set difference: elements in the current set that are not in the other set.

Parameters:

other (PackageSet) – The set to check for differences in.

Raises:

UsedDifferentSack When the sets entering the operation do not share the same PackageSack.

Since: 5.0

empty()
Return type:

boolean

Returns:

true if the set is empty, false otherwise.

Since: 5.0

end()
get_base()
intersection(other)

Set intersection: elements in the current set that are also in the other set.

Parameters:

other (PackageSet) – The set to intersect with.

Raises:

UsedDifferentSack When the sets entering the operation do not share the same PackageSack.

Since: 5.0

remove(pkg)

Remove pkg from the set.

Parameters:

pkg (Package) – Package to be removed from the set.

Since: 5.0

size()
Return type:

int

Returns:

Number of elements in the set.

swap(other)
thisown
update(other)

Set union: elements that are in the current set or in the other set.

Parameters:

other (PackageSet) – The set to unify with.

Raises:

UsedDifferentSack When the sets entering the operation do not share the same PackageSack.

Since: 5.0

class libdnf5.rpm.PackageSetIterator(other)
begin(*args)
end(*args)
next()
thisown
value()
libdnf5.rpm.PackageSet__iter__(self)
class libdnf5.rpm.PairBoolNevra(*args)
first
second
thisown
class libdnf5.rpm.Reldep(*args)

Represent a relational dependency from libsolv

CmpType_EQ
CmpType_GT
CmpType_GTE
CmpType_LT
CmpType_LTE
CmpType_NONE
get_base()

Return weak pointer to base

get_hash()

Return unique ID representing Reldep

get_id()
get_name()
get_relation()
get_version()
static is_rich_dependency(pattern)

Test if pattern is rich dependency Return true if pattern start with “(”

thisown
to_string()
to_string_description()

Provide descriptive information about instance including string value and ID

class libdnf5.rpm.ReldepId(*args)
id
thisown
class libdnf5.rpm.ReldepList(*args)
add(*args)
add_reldep(reldep_str)

Adds a reldep from Char*. It does not support globs.

Parameters:

reldep_str (string) – p_reldepStr: Char*

Return type:

boolean

Returns:

bool false if parsing or reldep creation fails

add_reldep_with_glob(reldep_str)

Adds a reldep from Char*. Only globs in name are processed. The process is slow therefore if reldepStr is not a glob please use addReldep() instead.

Parameters:

reldep_str (string) – p_reldepStr: Char*

Return type:

boolean

Returns:

bool - false if parsing or reldep creation fails

append(source)
begin()
clear()

Remove all RelDeps

empty()

Return true if container is empty

end()
get(index)
get_base()
get_id(index)
size()
thisown
class libdnf5.rpm.ReldepListIterator(*args)
begin()
end()
next()
thisown
value()
libdnf5.rpm.ReldepList__iter__(self)
class libdnf5.rpm.RpmSignature(*args)
CheckResult_FAILED
CheckResult_FAILED_KEY_MISSING
CheckResult_FAILED_NOT_SIGNED
CheckResult_FAILED_NOT_TRUSTED
CheckResult_OK
CheckResult_SKIPPED
check_package_signature(*args)

Overload 1: Check signature of the package using public keys stored in rpm database. The method respects the repository’s pkg_gpgcheck option (or localpkg_gpgcheck for packages originating from the command line) and skips the check if these options are set to false. :param package:: package to check. :rtype: int :return: CheckResult::OK - the check passed

CheckResult::SKIPPED - the check was skipped CheckResult::FAILED_KEY_MISSING - no corresponding key found in rpmdb CheckResult::FAILED_NOT_TRUSTED - signature is valid but the key is not trusted CheckResult::FAILED_NOT_SIGNED - package is not signed but signature is required CheckResult::FAILED - check failed for another reason


Overload 2: Check signature of rpm file in path location using public keys stored in rpm database. :param package:: package to check. :rtype: int :return: CheckResult::OK - the check passed

CheckResult::FAILED_KEY_MISSING - no corresponding key found in rpmdb CheckResult::FAILED_NOT_TRUSTED - signature is valid but the key is not trusted CheckResult::FAILED_NOT_SIGNED - package is not signed but signature is required CheckResult::FAILED - check failed for another reason

static check_result_to_string(result)

Return string representation of the CheckResult enum

import_key(key)

Import public key into rpm database. :type key: KeyInfo :param key:: OpenPGP key to be imported into rpm database.

key_present(key)

Check public key presence in rpm database

parse_key_file(key_url)

Download the key file if needed and return a vector of keys contained in it :type key_url: string :param key_url:: URL of the public key to be imported.

thisown
class libdnf5.rpm.SwigPyIterator(*args, **kwargs)
advance(n)
copy()
decr(n=1)
distance(x)
equal(x)
incr(n=1)
next()
previous()
thisown
value()
class libdnf5.rpm.TransactionCallbacks

The base class for Transaction callbacks. User implements Transaction callbacks by inheriting this class and overriding its methods.

Typical order in which the transaction callbacks are called is:

  • before_begin

  • verification phase: verify_start, verify_progress, verify_stop

  • script_start, script_stop, script_error for pre transaction scriplets

  • preparation phase: transaction_start, transaction_progress, transaction_stop

  • install packages: elem_progress, install_start, install_progress, install_stop, with their scriptlets

  • remove packages: elem_progress, uninstall_start, uninstall_progress, uninstall_stop, with their scriptlets

  • script_start, script_stop, script_error for post transaction scriplets

  • after_complete

ScriptType_POSTUN_TRANSACTION
ScriptType_POST_INSTALL
ScriptType_POST_TRANSACTION
ScriptType_POST_UNINSTALL
ScriptType_PREUN_TRANSACTION
ScriptType_PRE_INSTALL
ScriptType_PRE_TRANSACTION
ScriptType_PRE_UNINSTALL
ScriptType_SYSUSERS
ScriptType_TRIGGER_INSTALL
ScriptType_TRIGGER_POST_UNINSTALL
ScriptType_TRIGGER_PRE_INSTALL
ScriptType_TRIGGER_UNINSTALL
ScriptType_UNKNOWN
after_complete(success)

Called after the transaction run finished :type success: boolean :param success: Whether the rpm transaction was completed successfully

before_begin(total)

Called right before the rpm transaction is run :type total: int :param total: Number of elements in the rpm transaction

cpio_error(item)

cpio error during the package installation. Currently not used by librpm.

Parameters:

item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance representing the package that caused the error

elem_progress(item, amount, total)

The installation/removal process for the item has started

Parameters:
  • amount (int) – Index of the package currently being processed. Items are indexed starting from 0.

  • total (int) – The total number of packages in the transaction

install_progress(item, amount, total)

Report the package installation progress periodically.

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • amount (int) – The portion of the package already installed

  • total (int) – The disk space used by the package after installation

install_start(item, total)

Installation of a package has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • total (int) – The disk space used by the package after installation

install_stop(item, amount, total)

Installation of a package finished

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • amount (int) – The portion of the package that has been installed

  • total (int) – The disk space used by the package after installation

script_error(item, nevra, type, return_code)

Execution of the rpm scriptlet finished with error

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction.

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

  • return_code (int) – The return code of the scriptlet execution

script_start(item, nevra, type)

Execution of the rpm scriptlet has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction (e.g., a package installation triggered an update of the man database, owned by man-db package).

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

script_stop(item, nevra, type, return_code)

Execution of the rpm scriptlet finished without critical error

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction.

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

  • return_code (int) – The return code of the scriptlet execution

static script_type_to_string(type)
Parameters:

type (int) – scriptlet type

Return type:

string

Returns:

string representation of the scriptlet type

thisown
transaction_progress(amount, total)

Preparation of a package has started.

Parameters:
  • amount (int) – Index of the package currently being prepared. Items are indexed starting from 0.

  • total (int) – The total number of packages in the transaction

transaction_start(total)

Preparation phase has started.

Parameters:

total (int) – The total number of packages in the transaction

transaction_stop(total)

Preparation phase finished.

Parameters:

total (int) – The total number of packages in the transaction

uninstall_progress(item, amount, total)

Report the package removal progress periodically.

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • amount (int) – The portion of the package already uninstalled

  • total (int) – The disk space freed by the package after removal

uninstall_start(item, total)

Removal of a package has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • total (int) – The disk space freed by the package after removal

uninstall_stop(item, amount, total)

Removal of a package finished

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • amount (int) – The portion of the package already uninstalled

  • total (int) – The disk space freed by the package after removal

unpack_error(item)

Unpacking of the package failed.

Parameters:

item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance representing the package that failed to unpack

verify_progress(amount, total)

Verification of a package files has started.

Parameters:
  • amount (int) – Index of the package currently being verified. Items are indexed starting from 0.

  • total (int) – The total number of packages to verify

verify_start(total)

Packages files verification phase has started. In this phase the signature of packages are verified.

Parameters:

total (int) – The total number of packages to verify

verify_stop(total)

Packages files verification phase finished.

Parameters:

total (int) – The total number of packages to verify

class libdnf5.rpm.TransactionCallbacksUniquePtr(*args)
after_complete(success)

Called after the transaction run finished :type success: boolean :param success: Whether the rpm transaction was completed successfully

before_begin(total)

Called right before the rpm transaction is run :type total: int :param total: Number of elements in the rpm transaction

cpio_error(item)

cpio error during the package installation. Currently not used by librpm.

Parameters:

item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance representing the package that caused the error

elem_progress(item, amount, total)

The installation/removal process for the item has started

Parameters:
  • amount (int) – Index of the package currently being processed. Items are indexed starting from 0.

  • total (int) – The total number of packages in the transaction

get()
install_progress(item, amount, total)

Report the package installation progress periodically.

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • amount (int) – The portion of the package already installed

  • total (int) – The disk space used by the package after installation

install_start(item, total)

Installation of a package has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • total (int) – The disk space used by the package after installation

install_stop(item, amount, total)

Installation of a package finished

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being installed

  • amount (int) – The portion of the package that has been installed

  • total (int) – The disk space used by the package after installation

release()
reset(__p=None)
script_error(item, nevra, type, return_code)

Execution of the rpm scriptlet finished with error

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction.

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

  • return_code (int) – The return code of the scriptlet execution

script_start(item, nevra, type)

Execution of the rpm scriptlet has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction (e.g., a package installation triggered an update of the man database, owned by man-db package).

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

script_stop(item, nevra, type, return_code)

Execution of the rpm scriptlet finished without critical error

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package that owns the executed or triggered scriptlet. It can be nullptr if the scriptlet owner is not part of the transaction.

  • nevra (Nevra) – Nevra of the package that owns the executed or triggered scriptlet.

  • type (int) – Type of the scriptlet

  • return_code (int) – The return code of the scriptlet execution

script_type_to_string(type)
Parameters:

type (int) – scriptlet type

Return type:

string

Returns:

string representation of the scriptlet type

swap(__u)
thisown
transaction_progress(amount, total)

Preparation of a package has started.

Parameters:
  • amount (int) – Index of the package currently being prepared. Items are indexed starting from 0.

  • total (int) – The total number of packages in the transaction

transaction_start(total)

Preparation phase has started.

Parameters:

total (int) – The total number of packages in the transaction

transaction_stop(total)

Preparation phase finished.

Parameters:

total (int) – The total number of packages in the transaction

uninstall_progress(item, amount, total)

Report the package removal progress periodically.

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • amount (int) – The portion of the package already uninstalled

  • total (int) – The disk space freed by the package after removal

uninstall_start(item, total)

Removal of a package has started

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • total (int) – The disk space freed by the package after removal

uninstall_stop(item, amount, total)

Removal of a package finished

Parameters:
  • item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance for the package currently being removed

  • amount (int) – The portion of the package already uninstalled

  • total (int) – The disk space freed by the package after removal

unpack_error(item)

Unpacking of the package failed.

Parameters:

item (libdnf5::base::TransactionPackage) – The TransactionPackage class instance representing the package that failed to unpack

verify_progress(amount, total)

Verification of a package files has started.

Parameters:
  • amount (int) – Index of the package currently being verified. Items are indexed starting from 0.

  • total (int) – The total number of packages to verify

verify_start(total)

Packages files verification phase has started. In this phase the signature of packages are verified.

Parameters:

total (int) – The total number of packages to verify

verify_stop(total)

Packages files verification phase finished.

Parameters:

total (int) – The total number of packages to verify

class libdnf5.rpm.VectorChangelog(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorKeyInfo(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorNevra(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorNevraForm(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorPackage(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorVectorPackage(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorVersionlockCondition(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VectorVersionlockPackage(*args)
append(x)
assign(n, x)
back()
begin()
capacity()
clear()
empty()
end()
erase(*args)
front()
get_allocator()
insert(*args)
iterator()
pop()
pop_back()
push_back(x)
rbegin()
rend()
reserve(n)
size()
swap(v)
thisown
class libdnf5.rpm.VersionlockCondition(key_str, comparator_str, value)

A condition for the versionlock package. Each condition consist of three parts: key, comparison operator, and value. Key can be one of “epoch”, “evr”, “arch”. Supported comparison operators are “<”, “<=”, “=”, “>=”, “>”, “!=”. Since: 5.1.13

Keys_ARCH
Keys_EPOCH
Keys_EVR
get_comparator()

Get the comparison operator.

get_comparator_str()

Get the comparison operator as a string.

get_errors()

Get list of errors found during parsing the entry from configuration file.

get_key()

Get the key (which part of a package is compared).

get_key_str()

Get the key as a string.

get_value()

Get the value.

is_valid()

Returns true if this configuration entry is valid - contains supported values in all three parts (key, operator, and value).

thisown
to_string(with_errors)

Converts the condition to “key operator value” string usable for printing. :type with_errors: boolean :param with_errors: Include also error messages for invalid entries

class libdnf5.rpm.VersionlockConfig(*args, **kwargs)

Class contains parsed versionlock configuration file. Since: 5.1.13

get_packages()

Get list of configured versionlock entries.

save()

Save configuration to the file specified in the constructor.

thisown
class libdnf5.rpm.VersionlockPackage(name, conditions)

One versionlock configuration file entry. It consists of the package name and a set of conditions. All conditions must be true for package version to get locked. Since: 5.1.13

add_condition(condition)

Add a new condition for the package

get_comment()

Get the comment for this entry.

get_conditions()

Get the list of conditions configured for the package.

get_errors()

Get list of errors found during parsing the entry from configuration file.

get_name()

Get the package name.

is_valid()

Returns true if this configuration entry is valid.

set_comment(comment)

Set comment for this entry.

thisown
to_string(with_errors, with_comment)

Converts the package configuration to string usable for printing. :type with_errors: boolean :param with_errors: Include also error messages for invalid entries

libdnf5.rpm.get_base_arch(arch)

Returns base architecture of the given arch. In case the base arch is not found the function returns empty string. :type arch: string :param arch: Architecture.

libdnf5.rpm.get_supported_arches()

Returns a list of architectures supported by libdnf5.

libdnf5.rpm.rpmvercmp(lhs, rhs)

Compare alpha and numeric segments of two versions. :rtype: int :return: 1 if lhs < rhs, -1 if lhs > rhs, 0 if they are equal