(added in 2.0)
When removing package - force remove package, without any checks. When update_cache - force redownload repo databases.
Name of the package to install, upgrade, or remove.
aliases: pkg, package
(added in 1.3)
When removing a package, also remove its dependencies, provided that they are not required by other packages and were not explicitly installed by a user.
Desired state of the package.
Whether or not to refresh the master package lists. This can be run as part of a package installation or as a separate step.
(added in 2.0)
Whether or not to upgrade whole system
# Install package foo - pacman: name: foo state: present # Upgrade package foo - pacman: name: foo state: latest update_cache: yes # Remove packages foo and bar - pacman: name: foo,bar state: absent # Recursively remove package baz - pacman: name: baz state: absent recurse: yes # Run the equivalent of "pacman -Sy" as a separate step - pacman: update_cache: yes # Run the equivalent of "pacman -Su" as a separate step - pacman: upgrade: yes # Run the equivalent of "pacman -Syu" as a separate step - pacman: update_cache: yes upgrade: yes # Run the equivalent of "pacman -Rdd", force remove package baz - pacman: name: baz state: absent force: yes
Common return values are documented here Return Values, the following are the fields unique to this module:
|packages||a list of packages that have been changed||when upgrade is set to yes||list||['package', 'other-package']|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.