AptMixin

AptMixin(*, apt_updated: ‘bool’ = False, apt_dirty: ‘bool’ = True)

Usage

Source

AptMixin()

Parameter Attributes

apt_updated: bool = False
apt_dirty: bool = True

Methods

Name Description
apt_install() Install apt packages, inserting apt-get update only when stale.
add_apt_ppa() Add a PPA and mark the package lists stale.
add_apt_repo() Add a third-party apt repository with its signing key.

apt_install()

Install apt packages, inserting apt-get update only when stale.

Usage

Source

apt_install(*packages, fast=False)

An update runs before the first install and again after anything that dirties the package lists (add_apt_ppa, add_apt_repo), so you never write apt-get update by hand and never run it redundantly.

Parameters
*packages: str

Package names to install.

fast: bool = False
Install with apt-fast instead of apt-get (requires apt-fast to be installed first).

add_apt_ppa()

Add a PPA and mark the package lists stale.

Usage

Source

add_apt_ppa(ppa)

The next apt_install re-runs apt-get update so the PPA’s packages are visible.

Parameters
ppa: str
PPA spec, e.g. ppa:apt-fast/stable.

add_apt_repo()

Add a third-party apt repository with its signing key.

Usage

Source

add_apt_repo(key_url, repo_url, *, name)

Fetches the GPG key, dearmors it into /usr/share/keyrings, writes a signed-by source list, and marks the package lists stale so the next apt_install re-runs apt-get update.

Parameters
key_url: str

URL of the repository’s GPG key.

repo_url: str

The deb line’s repository and components, e.g. https://example.com/apt stable main.

name: str
Basename for the keyring and source-list files.