message saying Another app is currently holding the yum lock waiting for it to exit when trying to install Ansible

+1 vote

I've installed Ansible on Oracle's Virtual Machine and mounted /dev/sr0 and configured system.repo under /etc/yum.repos.d as below.


But the yum command isn't working, I get this error;

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

I made a few chnages and then I got another error;

Existing lock /var/run/ another copy is running as pid 2448. Another app is currently holding the yum lock; waiting for it to exit...
Jan 13, 2019 in Ansible by Lara

2 answers to this question.

+1 vote

Follow these steps;

  • Install epel repo properly, looks like it hasn't been installed correctly
yum search epel
yum install epel-release
  • Restart your yum service:

service yum restart
  • Find the ansible package:

yum search ansible
  • And then install ansible

yum install ansible

answered Jan 13, 2019 by Anjali
+2 votes


I may not sure about the answer but could you please try it by following way:

Generally, this error will encounter due to another instance is running yum command at the same time check which process is running by using PID in the output error and kill the process.

Once the process is killed you can try it once.

Below is the command to kill the process

kill 1432(PID value)--Here I have taken an example

Below is the command to find which process is taking more :

ps -ef

answered Jan 24, 2020 by vivek
• 530 points
Thanks, @Vivek. I have upvoted your answer.

Related Questions In Ansible

0 votes
1 answer
0 votes
2 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
+1 vote
2 answers

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 14, 2018 in Ansible by DareDev
• 6,890 points
+1 vote
2 answers

What is the difference between ansible playbook and roles?

Hi, Roles: Roles containing certain vars_files, tasks, and handlers ...READ MORE

answered Jan 21, 2020 in Ansible by vivek
• 530 points