Goal

class libdnf5.base.Goal(*args)

Centralized point to perform operations with RPMs, Comps groups, and Modules

add_downgrade(*args)

High level API for an artifact downgrade. See add_install() for details. :type spec: string :param spec: A string with upgrade spec :type settings: GoalJobSettings, optional :param settings: A structure to override default goal settings.

add_group_install(*args)

Add group install request to the goal. The spec will be resolved to groups in the resolve() call. Also packages of the types specified in setting.group_package_types be installed.

Parameters:
  • spec (string) – A string describing the Goal group install request.

  • reason (int) – Reason why the group is installed (USER/DEPENDENCY)

  • settings (GoalJobSettings, optional) – A structure to override default goal settings.

add_group_remove(*args)

Add group remove request to the goal. The spec will be resolved to groups in the resolve() call. Also packages not belonging to another group and not explicitly user-installed will get removed.

Parameters:
  • spec (string) – A string describing the Goal group remove request.

  • reason (int) – Reason why the group is removed.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings.

add_group_upgrade(*args)

Add group upgrade request to the goal. Upgrades the packages from the group and upgrades the group itself. The latter comprises of installing packages that were added to the group by the distribution and removing packages that got removed from the group as far as they were not installed explicitly by the user and are not required by any other installed package.

Parameters:
  • spec (string) – A string with group specification

  • settings (GoalJobSettings, optional) – A structure to override default goal settings.

add_install(*args)

High level API for an artifact installation. A spec can be either a package specification matched against NEVRA, provides, and file provides, or it can be a path to local rpm file, or URL of rpm to be installed. By using `` prefix you can also specify a group, environmental group, or a module to be installed. :type spec: string :param spec: A string with installation spec :type settings: GoalJobSettings, optional :param settings: A structure to override default goal settings.

add_module_disable(spec, settings)

Add module disable request to the goal. :type spec: string :param spec: A string with module spec to disable. :type settings: GoalJobSettings :param settings: A structure to override default goal settings.

add_module_enable(spec, settings)

Add module enable request to the goal. :type spec: string :param spec: A string with module spec to enable. :type settings: GoalJobSettings :param settings: A structure to override default goal settings.

add_module_reset(spec, settings)

Add module reset request to the goal. :type spec: string :param spec: A string with module spec to reset. :type settings: GoalJobSettings :param settings: A structure to override default goal settings.

add_provide_install(*args)

Request to install providers of the spec. Useful to install package using rich dependencies. The spec (e.g. “(depA and depB)”) is not parsed but directly passed to the solver to install package(s) which provide the spec. Solver then creates a job like: “job install provides depA and depB”.

Parameters:
  • spec (string) – A string with libsolv relational dependency.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. The value from_repo_ids is not used.

add_reinstall(*args)

High level API for an artifact reinstall. See add_install() for details. :type spec: string :param spec: A string with reinstall spec :type settings: GoalJobSettings, optional :param settings: A structure to override default goal settings.

add_remove(*args)

High level API for an artifact removal. See add_install() for details. :type spec: string :param spec: A string with reinstall spec :type settings: GoalJobSettings, optional :param settings: A structure to override default goal settings.

add_rpm_distro_sync(*args)

Overload 1: Add distrosync request to the goal. The spec will be resolved to packages in the resolve() call. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal distrosync request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. The value from_repo_ids is not used.


Overload 2: Add distrosync job of all installed packages to the goal if not limited in settings. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:

settings (GoalJobSettings, optional) – A structure to override default goal settings. Values from_repo_ids is not used.


Overload 3: Add distrosync job of all installed packages to the goal if not limited in settings. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:

settings – A structure to override default goal settings. Values from_repo_ids is not used.


Overload 4: Add distrosync request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • rpm_package (Package) – A package hat will be used as candidate for the distrosync action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove values are used.


Overload 5: Add distrosync request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • rpm_package (Package) – A package hat will be used as candidate for the distrosync action.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove values are used.


Overload 6: Add distrosync request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the distrosync action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove values are used.


Overload 7: Add distrosync request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the distrosync action.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove values are used.

add_rpm_downgrade(*args)

Overload 1: Add downgrade request to the goal. The spec will be resolved to packages in the resolve() call. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal downgrade request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. The value from_repo_ids is not used.


Overload 2: Add downgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings. Ignores obsoletes. Only installed packages with the same name, architecture and higher version can be downgraded. Skips package if the same or lower version is installed.

Parameters:
  • rpm_package (Package) – A package that will be used as candidate for the downgrade action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 3: Add downgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings. Ignores obsoletes. Only installed packages with the same name, architecture and higher version can be downgraded. Skips package if the same or lower version is installed.

Parameters:
  • rpm_package (Package) – A package that will be used as candidate for the downgrade action.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.

add_rpm_install(*args)

Overload 1: Add install request to the goal. The spec will be resolved to packages in the resolve() call. The operation will not result in a reinstall if the requested package is already installed. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal install request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. The value from_repo_ids is not used.


Overload 2: Add install request to the goal. The operation will not result in a reinstall when requested package with the same NEVRA is already installed. By default uses clean_requirements_on_remove set to false.

Parameters:
  • rpm_package (Package) – A package to be installed.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 3: Add install request to the goal. The operation will not result in a reinstall when requested package with the same NEVRA is already installed. By default uses clean_requirements_on_remove set to false.

Parameters:
  • rpm_package (Package) – A package to be installed.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 4: Add install request to the goal. The operation will not result in a reinstall when requested package with the same NEVRA is already installed. By default uses clean_requirements_on_remove set to false.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the install action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 5: Add install request to the goal. The operation will not result in a reinstall when requested package with the same NEVRA is already installed. By default uses clean_requirements_on_remove set to false.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the install action.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.

add_rpm_install_or_reinstall(*args)

Overload 1: Add install or reinstall request to the goal. By default uses clean_requirements_on_remove set to false.

Parameters:
  • rpm_package (Package) – A package to be installed or reinstalled.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 2: Add install or reinstall request to the goal. By default uses clean_requirements_on_remove set to false.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the install or reinstall action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 3: Add install or reinstall request to the goal. By default uses clean_requirements_on_remove set to false.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the install or reinstall action.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.

add_rpm_reason_change(*args)

Add reason change request to the goal.

Parameters:
  • spec (string) – A string describing the requested package

  • reason (int) – New reason for the package

  • group_id (string, optional) – Id of group the package belongs to (only relevant in case the reason is GROUP)

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only ResolveSpecSettings values are used

add_rpm_reinstall(*args)

Overload 1: Add reinstall request to the goal. The spec will be resolved to packages in the resolve() call. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal reinstall request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. The value from_repo_ids is not used (not implemented yet).


Overload 2: Add reinstall request to the goal. By default uses clean_requirements_on_remove set to false.

Parameters:
  • rpm_package (Package) – A package to be reinstalled.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.


Overload 3: Add reinstall request to the goal. By default uses clean_requirements_on_remove set to false.

Parameters:
  • rpm_package (Package) – A package to be reinstalled.

  • settings – A structure to override default goal settings. Only strict, best, and clean_requirements_on_remove are used.

add_rpm_remove(*args)

Overload 1: Add remove request to the goal. The spec will be resolved to packages in the resolve() call. By default uses clean_requirements_on_remove according to ConfigMain, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal remove request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Values strict and best are not used.


Overload 2: Add remove request to the goal. By default uses clean_requirements_on_remove value from ConfigMain, which can be overridden in settings.

Parameters:
  • rpm_package (Package) – A package to be removed.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove is used.


Overload 3: Add remove request to the goal. By default uses clean_requirements_on_remove value from ConfigMain, which can be overridden in settings.

Parameters:
  • rpm_package (Package) – A package to be removed.

  • settings – A structure to override default goal settings. Only clean_requirements_on_remove is used.


Overload 4: Add remove request to the goal. By default uses clean_requirements_on_remove value from ConfigMain, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing packages that will be removed

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove is used.


Overload 5: Add remove request to the goal. By default uses clean_requirements_on_remove value from ConfigMain, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing packages that will be removed

  • settings – A structure to override default goal settings. Only clean_requirements_on_remove is used.

add_rpm_upgrade(*args)

Overload 1: Add upgrade request to the goal. The spec will be resolved to packages in the resolve() call. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • spec (string) – A string describing the Goal upgrade request.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Values from_repo_ids and strict are not used.

  • minimal (boolean, optional) – Whether to do smallest possible upgrade


Overload 2: Add upgrade job of all installed packages to the goal if not limited in settings. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Values from_repo_ids and strict are not used.

  • minimal (boolean, optional) – Whether to do smallest possible upgrade


Overload 3: Add upgrade job of all installed packages to the goal if not limited in settings. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Values from_repo_ids and strict are not used.

  • minimal – Whether to do smallest possible upgrade


Overload 4: Add upgrade job of all installed packages to the goal if not limited in settings. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • settings – A structure to override default goal settings. Values from_repo_ids and strict are not used.

  • minimal – Whether to do smallest possible upgrade


Overload 5: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings. Supports obsoletes and architecture change to/from “noarch”.

Parameters:
  • rpm_package (Package) – A package that will be used as candidate for the upgrade action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal (boolean, optional) – Whether to do smallest possible upgrade


Overload 6: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings. Supports obsoletes and architecture change to/from “noarch”.

Parameters:
  • rpm_package (Package) – A package that will be used as candidate for the upgrade action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal – Whether to do smallest possible upgrade


Overload 7: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings. Supports obsoletes and architecture change to/from “noarch”.

Parameters:
  • rpm_package (Package) – A package that will be used as candidate for the upgrade action.

  • settings – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal – Whether to do smallest possible upgrade


Overload 8: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the upgrade action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal (boolean, optional) – Whether to do smallest possible upgrade


Overload 9: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the upgrade action.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal – Whether to do smallest possible upgrade


Overload 10: Add upgrade request to the goal. By default uses clean_requirements_on_remove set to false, which can be overridden in settings.

Parameters:
  • package_set (PackageSet) – A package_set containing candidates for the upgrade action.

  • settings – A structure to override default goal settings. Only clean_requirements_on_remove and best values are used.

  • minimal – Whether to do smallest possible upgrade

add_serialized_transaction(*args)

Warning: This method is experimental/unstable and should not be relied on. It may be removed without warning Add serialized transaction request to the goal. Only one serialized transaction can be added per goal.

Parameters:
  • transaction_path (std::filesystem::path) – A path to JSON serialized transaction.

  • settings (GoalJobSettings, optional) – A structure to override default goal settings. the packages and comps have relative paths in trans file.

add_upgrade(*args)

High level API for an artifact upgrade. See add_install() for details. :type spec: string :param spec: A string with upgrade spec :type settings: GoalJobSettings, optional :param settings: A structure to override default goal settings. :type minimal: boolean, optional :param minimal: Whether to do smallest possible upgrade

get_allow_erasing()

Return the currets setting of allow_erasing

get_base()
Return type:

BaseWeakPtr

Returns:

The Base object to which this object belongs.

Since: 5.0

reset()

Clean all request from the Goal instance

resolve()

Resolve all jobs and return a transaction object. Every time it resolves specs (strings) to packages

Return type:

Transaction

Returns:

transaction object

set_allow_erasing(value)

When true it allows to remove installed packages to resolve dependency problems

thisown