New in version 0.9.4: This module replaces the "yum" module in previous releases. It is backward compatibile and uses the native yum Python interface instead of the CLI interface.
Support for YUM
Required python modules: yum, rpm, rpmUtils
The available version of the package in the repository
CLI Example:
salt '*' pkg.available_version <package name>
Cleans local yum metadata.
CLI Example:
salt '*' pkg.clean_metadata
Install the passed package(s)
Return a dict containing the new package names and versions:
{'<package>': {'old': '<old-version>',
'new': '<new-version>']}
CLI Example:
salt '*' pkg.install 'package package package'
List the packages currently installed in a dict:
{'<package_name>': '<version>'}
CLI Example:
salt '*' pkg.list_pkgs
Check whether or not an upgrade is available for all packages
CLI Example:
salt '*' pkg.list_upgrades
Yum does not have a purge, this function calls remove
Return a list containing the removed packages:
CLI Example:
salt '*' pkg.purge <package name>
Since yum refreshes the database automatically, this runs a yum clean, so that the next yum operation will have a clean database
CLI Example:
salt '*' pkg.refresh_db
Removes packages with yum remove
Return a list containing the removed packages:
CLI Example:
salt '*' pkg.remove <package,package,package>
Run a full system upgrade, a yum upgrade
Return a dict containing the new package names and versions:
{'<package>': {'old': '<old-version>',
'new': '<new-version>']}
CLI Example:
salt '*' pkg.upgrade
Check whether or not an upgrade is available for a given package
CLI Example:
salt '*' pkg.upgrade_available <package name>
Returns a version if the package is installed, else returns an empty string
CLI Example:
salt '*' pkg.version <package name>