The Yum RPM software updater.
This is the configuration interface for the YumBase configuration. To change configuration settings such as whether plugins are on or off, or the value of debuglevel, change the values here. Later, when YumBase.conf() is first called, all of the options will be automatically configured.
This is the configuration interface for the repos configuration configuration. To change configuration settings such what callbacks are used, change the values here. Later, when YumBase.repos() is first called, all of the options will be automatically configured.
This excludes packages that are in repos. of lower cost than the passed repo.
Bases: yum.depsolve.Depsolve
This is a primary structure and base class. It houses the objects and methods needed to perform most things in yum. It is almost an abstract class in that you will need to add your own class above it for most real use.
Add and enable a repository.
Parameters: |
|
---|---|
Returns: | the new repository that has been added and enabled |
Return the best packages from a list of packages. This function is multilib aware, so that it will not compare multilib to singlelib packages.
Parameters: |
|
---|---|
Returns: | a list of the best packages from pkglist |
Go through the packages in the transaction set, find them in the packageSack or rpmdb, and pack up the transaction set accordingly.
Parameters: | unfinished_transactions_check – whether to check for unfinished transactions before building the new transaction |
---|
Delete the local data saying when the metadata and mirror lists were downloaded for each repository.
Delete the header files from the yum cache.
Delete the metadata files from the yum cache.
Delete the package files from the yum cache.
Delete any cached data from the local rpmdb.
Delete the sqlite files from the yum cache.
Delete the header and package files used in the transaction from the yum cache.
Close the history and repo objects.
Closes down the instances of rpmdb that could be open.
Yum Component/groups object
Yum Config Object
Create an excluder for repositories with higher costs. For example, if repo-A:cost=1 and repo-B:cost=2, this function will set up an excluder on repo-B that looks for packages in repo-B.
Unmark the packages in the given group from being installed.
Parameters: |
|
---|
Disable yum plugins.
Deprecated. Perform configuration setup.
Parameters: |
|
---|
Set up the logging file.
Parameters: |
|
---|
Do a default setup for all the normal or necessary yum components. This function is really just a shorthand for testing purposes.
Parameters: | cache – whether to run in cache only mode, which will run only from the system cache |
---|
Return two lists of groups: installed groups and available groups.
Parameters: |
|
---|
Deprecated. Create and populate the groups object.
Acquire the yum lock.
Parameters: | lockfile – the file to use for the lock |
---|---|
Raises : | yum.Errors.LockError |
Perform logging related setup.
Parameters: |
|
---|
Return a yum.misc.GenericHolder containing lists of package objects. The contents of the lists are specified in various ways by the arguments.
Parameters: |
|
---|---|
Returns: | a yum.misc.GenericHolder instance with the following lists defined: available = list of packageObjects
installed = list of packageObjects
updates = tuples of packageObjects (updating, installed)
extras = list of packageObjects
obsoletes = tuples of packageObjects (obsoleting, installed)
recent = list of packageObjects
|
Initialise and enable yum plugins. Note: _getConfig() will also initialise plugins if instructed to. Only call this method directly if not calling _getConfig() or calling doConfigSetup(init_plugins=False).
Parameters: |
|
---|
Deprecated. Set up the yum repositories.
Parameters: | thisrepo – the repository to set up. If None, all repositories will be set up |
---|---|
Returns: | the set up repos |
Deprecated. Set up the rpm database.
Convenience function to populate the repositories with the filelist metadata, and emit a log message only if new information is actually populated.
Deprecated. Populate the package sacks with information from our repositories.
Parameters: |
|
---|
Release the yum lock.
Parameters: | lockfile – the lock file to use. If not given, the file that was given as a parameter to the doLock() call that closed the lock is used |
---|
Deprecated. Set up the update object in the base class and populate the updates, obsoletes, and other lists.
Mark a package to be downgraded. This is equivalent to first removing the currently installed package, and then installing the older version.
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this method |
Raises : | yum.Errors.DowngradeError if no packages are specified or available for downgrade |
Mark a package on the local filesystem (i.e. not from a repository) to be downgraded.
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this method |
Download a header from a package object.
Parameters: | po – the package object to download the header from |
---|---|
Raises : | yum.Errors.RepoError if there are errors obtaining the header |
Download the packages specified by the given list of package objects.
Parameters: |
|
---|---|
Returns: | a dictionary containing errors from the downloading process |
Raises : | URLGrabError |
Remove packages from packageSacks based on global exclude lists, command line excludes and per-repository excludes.
Parameters: | repo – a repo object to use. If not given, all repositories are used |
---|
Return the dependencies for a given package object list, as well as possible solutions for those dependencies.
Parameters: | pkgs – a list of package objects |
---|---|
Returns: | the dependencies as a dictionary of dictionaries: packageobject = [reqs] = [list of satisfying pkgs] |
Retrieve a key for a repository. If needed, use the given callback to prompt whether the key should be imported.
Parameters: |
|
---|
Return a yum.packages.YumInstalledPackage object that corresponds to the given package tuple. This function should be used instead of searchPkgTuple() if you are assuming that the package object exists.
Parameters: | pkgtup – the package tuple specifying the package object to return |
---|---|
Returns: | a yum.packages.YumInstalledPackage object corresponding to the given package tuple |
Raises : | a yum.Errors.RpmDBError if the specified package object cannot be found |
Retrieve a key for a package. If needed, use the given callback to prompt whether the key should be imported.
Parameters: |
|
---|---|
Raises : | yum.Errors.YumBaseError if there are errors retrieving the keys |
Retrieve a key for a repository. If needed, use the given callback to prompt whether the key should be imported.
Parameters: |
|
---|
Return a package object that corresponds to the given package tuple.
Parameters: |
|
---|---|
Returns: | a package object corresponding to the given package tuple |
Raises : | a yum.Errors.DepError if no package corresponding to the given package tuple can be found, and allow_missing is False |
Read in repositories from the main yum conf file, and from .repo files. The location of the main yum conf file is given by self.conf.config_file_path, and the location of the directory of .repo files is given by self.conf.reposdir.
Read in repositories from a config .repo file.
Parameters: |
|
---|
Checks for the presence of GPG keys in the rpmdb.
Returns: | 0 if there are no GPG keys in the rpmdb, and 1 if there are keys |
---|
Mark all the packages in the given group to be removed.
Parameters: | grpid – the name of the group containing the packages to mark for removal |
---|---|
Returns: | a list of transaction members added to the transaction set by this function |
Unmark any packages in the given group from being removed.
Parameters: | grpid – the name of the group to unmark the packages of |
---|
Yum History Object
Repeat the transaction represented by the given yum.history.YumHistoryTransaction object.
Parameters: | transaction – a yum.history.YumHistoryTransaction object representing the transaction to be repeated |
---|---|
Returns: | whether the transaction was repeated successfully |
Undo the transaction represented by the given yum.history.YumHistoryTransaction object.
Parameters: | transaction – a yum.history.YumHistoryTransaction object representing the transaction to be undone |
---|---|
Returns: | whether the transaction was undone successfully |
Remove packages from packageSacks based on list of packages to include.
Parameters: | repo – the repository to use |
---|
Mark the specified item for installation. If a package object is given, mark it for installation. Otherwise, mark the best package specified by the key word arguments for installation.
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this function |
Raises : | yum.Errors.InstallError if there is a problem installing the package |
Mark a package on the local filesystem (i.e. not from a repository) for installation.
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this method |
Load a transaction from a .yumtx file.
Parameters: |
|
---|---|
Returns: | the members of the loaded transaction |
Raises : | yum.Errors.YumBaseError if there are problems loading the transaction |
Package sack object - object of yum package objects
Yum Package Tags Object
Process the current transaction. This involves the following steps:
- Download the packages
- Check the GPG signatures of the packages
- Run the test RPM transaction
- Run the RPM Transaction
The callback.event method is called at the start, and between each step.
Parameters: |
|
---|
Parse an INI file section for a repository.
Parameters: |
|
---|---|
Returns: | yum.yumRepo.YumRepository instance |
Mark the given package for reinstallation. This is accomplished by setting problem filters to allow a reinstall take place, then calling install().
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this method |
Raises : | yum.Errors.ReinstallRemoveError or yum.Errors.ReinstallInstallError depending the nature of the error that is encountered |
Mark a package on the local filesystem (i.e. not from a repository) for reinstallation.
Parameters: |
|
---|---|
Returns: | a list of the transaction members added to the transaction set by this method |
Mark the specified packages for removal. If a package object is given, mark it for removal. Otherwise, mark the package specified by the keyword arguments.
Parameters: |
|
---|---|
Returns: | a list of the transaction members that were added to the transaction set by this method |
Raises : | yum.Errors.RemoveError if nothing is specified to mark for removal |
Repo Storage object - object of yum repositories
Return a list of installed package objects that provide the given dependencies.
Parameters: | depstring – a string specifying the dependency to return the packages that fulfil |
---|---|
Returns: | a list of installed packages that fulfil the given dependency |
Return the best, or first, package object that provides the given dependencies.
Parameters: | depstring – a string specifying the dependency to return the package that fulfils |
---|---|
Returns: | the best, or first, package that fulfils the given dependency |
Raises : | a yum.Errors.YumBaseError if no packages that fulfil the given dependency can be found |
Return a list of package objects that provide the given dependencies.
Parameters: | depstring – a string specifying the dependency to return the packages that fulfil |
---|---|
Returns: | a list of packages that fulfil the given dependency |
RpmSack object
Perform the transaction.
Parameters: | cb – an rpm callback object to use in the transaction |
---|---|
Returns: | a yum.misc.GenericHolder containing information about the results of the transaction |
Raises : | yum.Errors.YumRPMTransError if there is a transaction cannot be completed |
Save out a transaction to a .yumtx file to be loaded later.
Parameters: |
|
---|---|
Raises : | yum.Errors.YumBaseError if there are errors saving the transaction |
Yield the packages that match the given search criteria. This generator method will lighten memory load for some searches, and is the preferred search function to use.
Parameters: |
|
---|
Search for and return a list package objects that provide the given files or features.
Parameters: |
|
---|
Search for and return a list packages that have tags matching the given criteria.
Parameters: | criteria – a list of strings specifying the criteria to search for |
---|---|
Returns: | a list of package objects that have tags matching the given criteria |
Deprecated. Search the specified fields for packages that match the given criteria, and return a list of the results.
Parameters: |
|
---|
Mark all the packages in the given group to be installed.
Parameters: |
|
---|---|
Returns: | a list of transaction members added to the transaction set by this function |
Set a new cache directory.
Parameters: |
|
---|---|
Returns: | whether the new cache directory is successfully set |
Verify the GPG signature of the given package object.
Parameters: | po – the package object to verify the signature of |
---|---|
Returns: | (result, error_string)
where result is:0 = GPG signature verifies ok or verification is not required.
1 = GPG verification failed but installation of the right GPG key
might help.
2 = Fatal GPG verification error, give up.
|
TransactionSet object
Transaction Set information object
Updates Object
Mark the specified items to be updated. If a package object is given, mark it. Else, if a package is specified by the keyword arguments, mark it. Finally, if nothing is given, mark all installed packages to be updated.
Parameters: |
|
---|---|
Returns: | a list of transaction members added to the transaction set by this function |
Verify that the checksum of the given file matches the given checksum.
Parameters: |
|
---|---|
Parm csum: | the checksum to check against |
Returns: | 0 if the checksums match |
Raises : | URLGrabError if there is an error performing the checksums, or the checksums do not match |
Check that the header of the given file object and matches the given package.
Parameters: |
|
---|---|
Returns: | 1 if the header matches the package object, and 0 if they do not match, and raiseError is False |
Raises : | URLGrabError if raiseError is True, and the header does not match the package object or cannot be read from the file |
Check that the checksum of a remote package matches what we expect it to be. If the checksum of the package file is wrong, and the file is also larger than expected, it cannot be redeemed, so delete it.
Parameters: |
|
---|---|
Returns: | True if the package is verified successfully. Otherwise, False will be returned, unless raiseError is 1, in which case a URLGrabError will be raised |
Raises : | URLGrabError if verification fails, and raiseError is 1 |
Check that the transaction did what was expected, and propagate external yumdb information. Output error messages if the transaction did not do what was expected.
Parameters: | resultobject – the yum.misc.GenericHolder object returned from the runTransaction() call that ran the transaction |
---|
Callback to call a plugin hook for pkg.verify().
Parameters: | verify_package – a conduit for the callback |
---|---|
Returns: | verify_package |
Output a message that the given tool requires the yum-utils package, if it not installed.
Parameters: |
|
---|