Pkgin Operations¶
Manage pkgin packages.
Facts used in these operations: pkgin.PkginPackages.
pkgin.packages¶
Add/remove/update pkgin packages.
pkgin.packages(packages=None, present=True, latest=False, update=False, upgrade=False)
- packages: list of packages to ensure
- present: whether the packages should be installed
- latest: whether to upgrade packages without a specified version
- update: run
pkgin updatebefore installing packages - upgrade: run
pkgin upgradebefore installing packages
Examples:
# Update package list and install packages
pkgin.packages(
name="Install tmux and Vim",
packages=["tmux", "vim"],
update=True,
)
# Install the latest versions of packages (always check)
pkgin.packages(
name="Install latest Vim",
packages=["vim"],
latest=True,
)
pkgin.update¶
Stateless operation
This operation will always execute commands and is not idempotent.
Updates pkgin repositories.
pkgin.update()
pkgin.upgrade¶
Stateless operation
This operation will always execute commands and is not idempotent.
Upgrades all pkgin packages.
pkgin.upgrade()
pyinfra 2.x