ansible, ubuntu,

How to install Ansible on Ubuntu

Jun 06, 2021 · 1 min read · Post a comment
How to install Ansible on Ubuntu

Ansible stands as an IT automation tool that can simplify the deployments of your applications, managing your infrastructure servers, and provides a lot of features and integrations with all the cloud providers and the CI/CD tools.

Install Ansible on Ubuntu

Step 1. Update the Ubuntu packages

sudo apt update

Step 2. Install software-properties-common package to easily manage your distribution and independent software vendor software sources like PPAs:

sudo apt install software-properties-common

Step 3. Now we need to add ppa:ansible/ansible to our systems software source list, so we can install the latest version of ansible:

sudo add-apt-repository --yes --update ppa:ansible/ansible

Step 4. To install the latest version of Ansible run:

sudo apt install ansible

Step 5. Make sure that you have the latest Ansible version installed:

ansible --version

NOTE: If you are installing Ansible on older Ubuntu distros, software-properties-common is called python-software-properties and you may need to user apt-get instead of apt

Remove Ansible from Ubuntu

Step 1. If you want to delete all the configuration files and data use:

sudo apt-get purge ansible

Step 2. If you need to remove all the configuration files and data associated with the ansible package use this command, but keep in mind that you can can’t recover the data, so, use this command with care:

sudo apt-get purge --auto-remove ansible


This tutorial shows you how to install the latest ansible version on Ubuntu, and if you decide to use other automation tool instead of ansible there is a section on how to remove it depending on your needs.