apt module manages packages and repositories on Debian-based systems using the apt package manager.
Functions
packages
Install, remove, or update apt packages.List of packages to ensure. Can be a single package name or a list of package names.
Whether the packages should be installed.
Whether to upgrade packages without a specified version.
Run
apt update before installing packages.When used with
update, cache package index for this many seconds.Run
apt upgrade before installing packages.Force package installs by passing
--force-yes to apt.Don’t install recommended packages.
Allow downgrading packages with version (—allow-downgrades).
Additional arguments to the apt install command.
Additional arguments to the apt uninstall command.
Package versions can be pinned like apt:
<pkg>=<version>Examples
update
Update apt package indexes.Cache updates for this many seconds. When set, the
/var/lib/apt/periodic/update-success-stamp file is touched upon successful update.upgrade
Upgrade all apt packages.Remove transitive dependencies that are no longer needed.
dist_upgrade
Upgrade all apt packages using dist-upgrade.Remove transitive dependencies that are no longer needed.
repo
Add or remove apt repositories.Apt source string, e.g.,
deb http://example.com hardy mainWhether the repo should exist on the system.
Optional filename to use
/etc/apt/sources.list.d/<filename>.list. By default uses /etc/apt/sources.list.ppa
Add or remove Ubuntu PPA repositories.The PPA name in full
ppa:user/repo format.Whether it should exist.
Requires
apt-add-repository (from software-properties-common) on the remote host.deb
Install or remove .deb package files.Filename or URL of the
.deb file.Whether the package should exist on the system.
Force package install by passing
--force-yes to apt.When installing,
apt-get install -f will be run to install any unmet dependencies.key
Add apt GPG keys.Filename or URL of the key file.
URL of keyserver to fetch key from.
Key ID or list of key IDs when using keyserver.
keyserver and keyid must be provided together.