Introduction:
Yum is a package management utility used in many Linux distributions to install, update, and remove software packages. Occasionally, when you try to use yum, you may get an error message that says “Another app is currently holding the yum lock; waiting for it to exit”. This error occurs when another process is currently using yum, and the lock file is preventing other processes from using yum.
Existing lock /var/run/yum.pid: another copy is running as pid [pid number]. Another app is currently holding the yum lock; waiting for it to exit...
or
[root@server /]# yum install [service name] Loaded plugins: fastestmirror Existing lock /var/run/yum.pid: another copy is running as pid 20360. Another app is currently holding the yum lock; waiting for it to exit... The other application is: yum Memory : 19 M RSS (396 MB VSZ) Started: Sun Mar 6 21:06:51 2011 - 00:29 ago State : Traced/Stopped, pid: 20360
In this guide, we will show you how to resolve this error.
Step 1: Check yum processes
The first step is to check if any processes are currently using yum. You can do this by running the following command:
ps aux | grep yum
This will display a list of processes that are currently using yum.
Step 2: Kill yum processes
If you find any processes that are using yum, you need to terminate them before you can use yum. You can do this by running the following command:
sudo kill PID
Replace PID with the process ID of the yum process you want to terminate. You may need to use the kill -9 option if the process does not terminate gracefully:
sudo kill -9 PID
Step 3: Remove yum lock file
After terminating the yum process, you need to remove the lock file to allow other processes to use yum. You can do this by running the following command:
sudo rm /var/run/yum.pid
This will remove the yum lock file.
Step 4: Verify yum availability
Finally, you can verify that yum is now available by running a yum command:
yum check-update
If yum is working correctly, you should see a list of available updates.
Commands Mentioned:
- ps aux – lists all processes
- grep – searches for a pattern in text
- kill – terminates a process
- rm – removes a file
- sudo – runs a command with root privileges
Conclusion:
In this guide, we have shown you how to resolve the “Another app is currently holding the yum lock; waiting for it to exit” error by checking for and terminating yum processes, removing the yum lock file, and verifying yum availability. By following these steps, you can resume using yum to install, update, and remove software packages.
18 Comments
Truly good example
thanks you very much to help me to resolve this error
THANK A LOOOOOOOOOOOOOOOOOOTe
Cool post very helpful
this command kill -9 disconnected the internet connection how can i get it back ?
Will Solution 1 kill the yum process that is running? I don’t want that to happen sometimes when RHEL patch is running ..
thanks!!!! solution 1 worked for me!
It is workable! Thank you very much!
Thanks, it worked. Just killed the process.
Thank you so much it’s really very helpful
Thanks
The 1st solution helped for me. Thanks)
thnks
not working: if killing the process or deleting yum.pid. error gets change to
new error :failed to connect to 192.168.43.56:21; No route to host
thanx to provide the solutions
Thank You Dear
Thanks it works
o the following to solve the problem:
cd /var/run
rm -f yum.pid
you could also update your yum afterward
yum -y update
Thank you very much
that’s great !