bash ansible command not found Failed to search for file Cannot update read-only repo

0 votes

Hi Guys,

I am trying to run ansible command in my Linux system, but it is showing me the below error.

[root@localhost ~]# ansible --version
bash: ansible: command not found...
Failed to search for file: Cannot update read-only repo

How can I solve this error?

Jul 28, 2020 in Ansible by akhtar
• 38,240 points

1 answer to this question.

0 votes


By default, Ansible is not part of your Linux system. You need to install this module in your system. Ansible module is a part of the Python package. You can use the below command to install this module in your Linux system.

[root@localhost ~]# pip3 install ansible
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Collecting ansible  Downloading (14.2MB)
    100% |████████████████████████████████| 14.3MB 54kB/s
Collecting jinja2 (from ansible) Downloading (125kB)
    100% |████████████████████████████████| 133kB 121kB/s
Requirement already satisfied: PyYAML in /usr/lib64/python3.6/site-packages (from ansible)
Requirement already satisfied: cryptography in /usr/lib64/python3.6/site-packages (from ansible)
Collecting MarkupSafe>=0.23 (from jinja2->ansible)  Downloading
Requirement already satisfied: idna>=2.1 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: asn1crypto>=0.21.0 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: cffi!=1.11.3,>=1.7 in /usr/lib64/python3.6/site-packages (from cryptography->ansible)
Requirement already satisfied: pycparser in /usr/lib/python3.6/site-packages (from cffi!=1.11.3,>=1.7->cryptography->ansible)
Installing collected packages: MarkupSafe, jinja2, ansible
  Running install for ansible ... done
Successfully installed MarkupSafe-1.1.1 ansible-2.9.11 jinja2-2.11.2

answered Jul 28, 2020 by MD
• 95,440 points

Related Questions In Ansible

0 votes
1 answer
0 votes
2 answers

ansible-command not found

Use some other variable instead of PATH. READ MORE

answered Apr 23, 2019 in Ansible by Vismaya
+1 vote
3 answers
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP