Pacman Operations

Manage pacman packages. (Arch Linux package manager)

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 -Syu 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

Updates pacman repositories.

pacman.update()

pacman.upgrade

Upgrades all pacman packages.

pacman.upgrade()