How to “Resolve Another app is currently holding the yum lock; waiting for it to exit”

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.

See also  How to Reset CentOS root Password

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.

See also  How to Install and Configure Apache2, PHP and MySQL 5.6 on Ubuntu 14.04

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.

Comments

18 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *