pacman – Manage packages with pacman¶
Synopsis¶
- Manage packages with the pacman package manager, which is used by Arch Linux and its variants.
Parameters¶
Notes¶
Note
- When used with a loop: each package will be processed individually, it is much more efficient to pass the list directly to the name option.
Examples¶
- name: Install package foo from repo
  pacman:
    name: foo
    state: present
- name: Install package bar from file
  pacman:
    name: ~/bar-1.0-1-any.pkg.tar.xz
    state: present
- name: Install package foo from repo and bar from file
  pacman:
    name:
      - foo
      - ~/bar-1.0-1-any.pkg.tar.xz
    state: present
- name: Upgrade package foo
  pacman:
    name: foo
    state: latest
    update_cache: yes
- name: Remove packages foo and bar
  pacman:
    name:
      - foo
      - bar
    state: absent
- name: Recursively remove package baz
  pacman:
    name: baz
    state: absent
    extra_args: --recursive
- name: Run the equivalent of "pacman -Sy" as a separate step
  pacman:
    update_cache: yes
- name: Run the equivalent of "pacman -Su" as a separate step
  pacman:
    upgrade: yes
- name: Run the equivalent of "pacman -Syu" as a separate step
  pacman:
    update_cache: yes
    upgrade: yes
- name: Run the equivalent of "pacman -Rdd", force remove package baz
  pacman:
    name: baz
    state: absent
    force: yes
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
| Key | Returned | Description | 
|---|---|---|
| packages 
                  list
                                       | when upgrade is set to yes | a list of packages that have been changed Sample: ['package', 'other-package'] | 
Status¶
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors¶
- Indrajit Raychaudhuri (@indrajitr)
- Aaron Bull Schaefer (@elasticdog) <aaron@elasticdog.com>
- Maxime de Roucy (@tchernomax)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
