Support for YUM
Members
The available version of the package in the repository
CLI Example:
salt '*' pkg.available_version <package name>
Install the passed package
Return a dict containing the new package names and versions:
{'<package>': {'old': '<old-version>',
'new': '<new-version>']}
CLI Example:
salt '*' pkg.install <package name>
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
Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22) # instantiate with positional args or keywords
>>> p[0] + p[1] # indexable like a plain tuple
33
>>> x, y = p # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y # fields also accessable by name
33
>>> d = p._asdict() # convert to a dictionary
>>> d['x']
11
>>> Point(**d) # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100) # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)
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
Remove a single package with yum remove
Return a list containing the removed packages:
CLI Example:
salt '*' pkg.remove <package name>
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