salt.states.pkg

### Navigation

- index
- modules |
- next |
- previous |
- « SaltStack.org |
- Documentation home
- Full list of builtin state modules »

# salt.states.pkg

## Installation of packages using OS package managers such as yum or apt-get.

Salt can manage software packages via the pkg state module, packages can be set up to be installed, latest, removed and purged. Package management declarations are typically rather simple:

    vim:
      pkg.installed

`salt.states.pkg.` `installed`(name, version=None, refresh=False, repo='', skip_verify=False, **kwargs)

  Verify that the package is installed, and only that it is installed. This state will not upgrade an existing package and only verify that it is installed

  name
    The name of the package to install
  repo
    Specify a non-default repository to install from
  skip_verify : False
    Skip the GPG verification check for the package to be installed
  version : None
    Install a specific version of a package

  Usage:

      httpd:
        pkg:
          - installed
          - repo: mycustomrepo
          - skip_verify: True
          - version: 2.0.6~ubuntu3

`salt.states.pkg.` `latest`(name, refresh=False, repo='', skip_verify=False, **kwargs)

  Verify that the named package is installed and the latest available package. If the package can be updated this state function will update the package. Generally it is better for the `installed` function to be used, as `latest` will update the package whenever a new package is available.

  name
    The name of the package to maintain at the latest available version
  repo : (default)
    Specify a non-default repository to install from
  skip_verify : False
    Skip the GPG verification check for the package to be installed

`salt.states.pkg.` `purged`(name)

  Verify that the package is purged, this will call the purge function in the salt pkg module for the platform.

  name
    The name of the package to be purged

`salt.states.pkg.` `removed`(name)

  Verify that the package is removed, this will remove the package via the remove function in the salt pkg module for the platform.

  name
    The name of the package to be removed

## Comments

comments powered by Disqus

### Navigation

- index
- modules |
- next |
- previous |
- « SaltStack.org |
- Documentation home
- Full list of builtin state modules »