salt.modules.xbpspkg

Package support for XBPS package manager (used by VoidLinux)

New in version 2016.11.0.

salt.modules.xbpspkg.add_repo(repo, conffile='/usr/share/xbps.d/15-saltstack.conf')

Add an XBPS repository to the system.

repo

url of repo to add (persistent).

conffile

path to xbps conf file to add this repo default: /usr/share/xbps.d/15-saltstack.conf

CLI Examples:

salt '*' pkg.add_repo <repo url> [conffile=/path/to/xbps/repo.conf]

salt.modules.xbpspkg.available_version(*names, **kwargs)

Return the latest version of the named package available for upgrade or installation. If more than one package name is specified, a dict of name/version pairs is returned.

If the latest version of a given package is already installed, an empty string will be returned for that package.

CLI Example:

salt '*' pkg.latest_version <package name>
salt '*' pkg.latest_version <package1> <package2> <package3> ...

salt.modules.xbpspkg.del_repo(repo, **kwargs)

Remove an XBPS repository from the system.

repo

url of repo to remove (persistent).

CLI Examples:

salt '*' pkg.del_repo <repo url>

salt.modules.xbpspkg.get_repo(repo, **kwargs)

Display information about the repo.

CLI Examples:

salt '*' pkg.get_repo 'repo-url'

salt.modules.xbpspkg.install(name=None, refresh=False, fromrepo=None, pkgs=None, sources=None, **kwargs)

Install the passed package

name

The name of the package to be installed.

refresh

Whether or not to refresh the package database before installing.

fromrepo

Specify a package repository (url) to install from.

Multiple Package Installation Options:

pkgs

A list of packages to install from a software repository. Must be passed as a python list.

CLI Example:

salt '*' pkg.install pkgs='["foo","bar"]'
sources

A list of packages to install. Must be passed as a list of dicts, with the keys being package names, and the values being the source URI or local path to the package.

CLI Example:

salt '*' pkg.install sources='[{"foo": "salt://foo.deb"},{"bar": "salt://bar.deb"}]'

Return a dict containing the new package names and versions:

{'<package>': {'old': '<old-version>',
               'new': '<new-version>'}}

CLI Example:

salt '*' pkg.install <package name>

salt.modules.xbpspkg.latest_version(*names, **kwargs)

Return the latest version of the named package available for upgrade or installation. If more than one package name is specified, a dict of name/version pairs is returned.

If the latest version of a given package is already installed, an empty string will be returned for that package.

CLI Example:

salt '*' pkg.latest_version <package name>
salt '*' pkg.latest_version <package1> <package2> <package3> ...

salt.modules.xbpspkg.list_pkgs(versions_as_list=False, **kwargs)

List the packages currently installed as a dict:

{'<package_name>': '<version>'}

CLI Example:

salt '*' pkg.list_pkgs

salt.modules.xbpspkg.list_repos(**kwargs)

List all repos known by XBPS

CLI Example:

salt '*' pkg.list_repos

salt.modules.xbpspkg.list_upgrades(refresh=True, **kwargs)

Check whether or not an upgrade is available for all packages

CLI Example:

salt '*' pkg.list_upgrades

salt.modules.xbpspkg.refresh_db(**kwargs)

Update list of available packages from installed repos

CLI Example:

salt '*' pkg.refresh_db

salt.modules.xbpspkg.remove(name=None, pkgs=None, recursive=True, **kwargs)

name

The name of the package to be deleted.

recursive

Also remove dependent packages (not required elsewhere). Default mode: enabled.

Multiple Package Options:

pkgs

A list of packages to delete. Must be passed as a python list. The name parameter will be ignored if this option is passed.

Returns a list containing the removed packages.

CLI Example:

salt '*' pkg.remove <package name> [recursive=False]
salt '*' pkg.remove <package1>,<package2>,<package3> [recursive=False]
salt '*' pkg.remove pkgs='["foo", "bar"]' [recursive=False]

salt.modules.xbpspkg.upgrade(refresh=True, **kwargs)

Run a full system upgrade

refresh

Whether or not to refresh the package database before installing. Default is True.

Returns a dictionary containing the changes:

{'<package>':  {'old': '<old-version>',
                'new': '<new-version>'}}

CLI Example:

salt '*' pkg.upgrade

salt.modules.xbpspkg.upgrade_available(name, **kwargs)

Check whether or not an upgrade is available for a given package

CLI Example:

salt '*' pkg.upgrade_available <package name>

salt.modules.xbpspkg.version(*names, **kwargs)

Returns a string representing the package version or an empty string if not installed. If more than one package name is specified, a dict of name/version pairs is returned.

CLI Example:

salt '*' pkg.version <package name>
salt '*' pkg.version <package1> <package2> <package3> ...

© 2021 SaltStack.
Licensed under the Apache License, Version 2.0.
https://docs.saltproject.io/en/latest/ref/modules/all/salt.modules.xbpspkg.html