Pacman Operations

Manage pacman packages. (Arch Linux package manager)

Facts used in these operations: pacman.PacmanPackages, pacman.PacmanUnpackGroup.

pacman.packages

Add/remove pacman packages.

pacman.packages(packages=None, present=True, update=False, upgrade=False)
  • packages: list of packages to ensure
  • present: whether the packages should be installed
  • update: run pacman -Sy before installing packages
  • upgrade: run pacman -Su before installing packages
Versions:
Package versions can be pinned like pacman: <pkg>=<version>.

Example:

pacman.packages(
    name="Install Vim and a plugin",
    packages=["vim-fugitive", "vim"],
    update=True,
)

pacman.update

Stateless operation

This operation will always execute commands and is not idempotent.

Updates pacman repositories.

pacman.update()

pacman.upgrade

Stateless operation

This operation will always execute commands and is not idempotent.

Upgrades all pacman packages.

pacman.upgrade()