> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Install Ansible on Ubuntu and Other Linux Distributions
- URL: https://linuxhandbook.com/install-ansible-linux/
- Published: 2018-11-13T11:18:03.000Z
- Updated: 2023-10-06T10:48:08.000Z
- Description: Learn to install Ansible on Linux in clear and precise steps. The tutorial is valid for Ubuntu, Debian, CentOS, Red Hat, SUSE etc.
- Author: LHB Community
- Tags: DevOps

*These days, [Ansible](https://www.ansible.com/?ref=linuxhandbook.com) is a big buzzword in the IT industry. It is a radical automation [DevOps](https://en.wikipedia.org/wiki/DevOps?ref=linuxhandbook.com) tool for IT orchestration.*

Ansible is an open-source tool by [Red Hat](https://www.redhat.com/en?ref=linuxhandbook.com). It helps to configure, provision, deploy and manage your system infrastructure across without facing any hassle.

Ansible is agentless and requires no extra software with it. It can connect via [SSH](https://www.ssh.com/ssh/protocol/?ref=linuxhandbook.com), remote PowerShell, and with remote APIs. It also uses a human-readable language, [YAML](http://yaml.org/?ref=linuxhandbook.com) so that one can easily adapt Ansible.

You have everything you need for your system automation in a complete package through Ansible.

## How to install Ansible on Linux

In this first article on Ansible, you’ll learn about installing Ansible on various Linux distributions.

**Personally, I prefer to get system information before installing any kind of software. Because It may help you in many aspects for different versions of an operating system.*

### Installing Ansible on Ubuntu and other Debian-based Linux distributions

Ansible is normally found in the default repositories of Ubuntu and Debian. You can use the command below to install it:

```
sudo apt install ansible
```

If Ansible package cannot be found, you can add the project’s PPA (personal package archive) to your system. You can add Ansible PPA by using the following command:

```
sudo apt-add-repository ppa:ansible/ansible
```

As you have added a new software source, you have to update your system to get packages available in the PPA. Update the software repositories list with this command: 

```
sudo apt update
```

Finally, you can install Ansible using this command:

```
sudo apt install ansible
```

After successful completion of the above command, Ansible will be installed on your system.

You should verify the installation by checking the version of Ansible you just installed:

```
ansible --version
```

### Installing Ansible on CentOS, Red Hat, Fedora, SUSE etc

To install the latest version on Ansible in CentOS or [RHEL](https://linuxhandbook.com/get-red-hat-linux-free/), you should install EPEL (Extra Packages for Enterprise Linux) first using the below command:

```
sudo yum install epel-release
```

Then you can easily install Ansible using this command:

```
sudo yum install ansible
```

You can check Ansible version using this command:

```
ansible --version
```

and its output

![Check Ansible version on Linux](https://linuxhandbook.com/content/images/2020/06/version.png)

## **How to uninstall Ansible**

If you want to uninstall Ansible for some reasons, you can easily do that.

#### Uninstall Ansible from Ubuntu/Debian

You can uninstall or remove Ansible from Ubuntu. Use this command:

```
sudo apt remove ansible
```

But if you want to remove Ansible along with its all dependency packages. Use this command:

```
sudo apt purge ansible
```

#### Uninstall Ansible from CentOS/Red Hat

You can uninstall or remove Ansible from CentOS using this command:

```
sudo yum remove ansible -y
```

**In the next article, I will cover how to connect and access several machines through SSH connection establishment using Ansible. Stay tuned for the Ansible tutorial series.*