Apk

Manage apk packages.

apk.packages

Add/remove/update apk packages.

apk.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 apk update before installing packages

  • upgrade: run apk upgrade before installing packages

Versions:

Package versions can be pinned like apk: <pkg>=<version>.

Examples:

# Update package list and install packages
apk.packages(
    name='Install Asterisk and Vim',
    packages=['asterisk', 'vim'],
    update=True,
)

# Install the latest versions of packages (always check)
apk.packages(
    name='Install latest Vim',
    packages=['vim'],
    latest=True,
)

apk.update

Updates apk repositories.

apk.update()

apk.upgrade

Upgrades all apk packages.

apk.upgrade()