Updated: 28 September 2026 · Applies to: Ansible (ansible-core 2.16+) on Ubuntu 24.04, Debian 12, AlmaLinux 9 and Rocky Linux 9

pip installs the newest Ansible from the Python Package Index. On current systems, install it with pipx or in a virtual environment; installing into the system Python with pip is blocked on Ubuntu 23.04 and newer.

With pipx (recommended)

sudo apt install pipx              # AlmaLinux/Rocky: dnf install epel-release && dnf install pipx
pipx ensurepath                      # log in again afterwards
pipx install --include-deps ansible
ansible --version

Upgrade later with pipx upgrade --include-injected ansible.

In a virtual environment

python3 -m venv ~/ansible-venv
source ~/ansible-venv/bin/activate
pip install ansible
ansible --version

ansible or ansible-core?

  • ansible includes ansible-core plus a large set of community collections (modules for many systems).
  • ansible-core is the engine with only the built-in modules; add collections with ansible-galaxy collection install.

See "Install and configure Ansible Automation IT Tool" for your first inventory and playbook.

Troubleshooting

  • ansible: command not found after installing with pipx: run pipx ensurepath and open a new terminal.
  • A module is missing: install its collection, for example ansible-galaxy collection install community.general.
  • Two versions installed: check which one runs with which -a ansible and remove the one you do not need.

Ucartz services for this topic

Was this answer helpful? 0 Users Found This Useful (0 Votes)