AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

How to Install Ansible on Ubuntu 26.04 (Ubiquitous Unicorn)

By Luca Berton · Published 2024-01-01 · Category: installation

Step-by-step guide to install Ansible on Ubuntu 26.04 Ubiquitous Unicorn using apt or pip. Includes verification steps and troubleshooting tips.

How to Install Ansible on Ubuntu 26.04 (Ubiquitous Unicorn)

Learn how to install Ansible on Ubuntu 26.04 "Ubiquitous Unicorn" using two methods: the system package manager (apt) and Python's pip package manager.

Prerequisites • Ubuntu 26.04 "Ubiquitous Unicorn" installed and updated • A user account with sudo privileges • Internet connection

Method 1: Install Ansible Using apt (Recommended)

Step 1: Update System Packages

Step 2: Install the Software Properties Common Package

Step 3: Add the Ansible PPA

Step 4: Install Ansible

Step 5: Verify the Installation

Expected output:

Method 2: Install Ansible Using pip

Step 1: Install Python3 and pip

Step 2: Create a Virtual Environment (Recommended)

Step 3: Install Ansible via pip

Step 4: Verify the Installation

Verify Ansible Works

Test connectivity to localhost:

Expected output:

Troubleshooting

Error: "add-apt-repository: command not found"

Install the required package:

Error: "externally-managed-environment"

Ubuntu 26.04 uses PEP 668. Use a virtual environment (Method 2) or install via apt (Method 1).

Multiple Python Versions

If you have multiple Python versions installed, set the interpreter explicitly in your ansible.cfg:

Uninstall Ansible

If installed via apt:

If installed via pip:

FAQ

What version of Python does Ubuntu 26.04 use?

Ubuntu 26.04 "Ubiquitous Unicorn" ships with Python 3.14.

Can I install ansible-core only?

Yes, use pip install ansible-core for a minimal installation without community collections.

What is the difference between apt and pip installation?

The apt method installs a system-wide package maintained by Ubuntu/PPA. The pip method gives you the latest version and more control, especially useful in virtual environments.

Related ArticlesHow to Install Ansible on Ubuntu 25.04How to Install Ansible on Ubuntu 24.04Ansible Extra Vars: Pass Variables via Command LineWhat is Ansible? A Complete Guide

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home