Everyone defiantly faced an above error another app is currently holding the yum lock; waiting for it to exit while working on centos or redhat linux environments. Generally the above error comes when you tried to install a new package in linux by using yum command.
If already one process is running with yum and you trigger another Yum command on the same node with out completion of first yum process then you will see the error like another app is currently holding the yum lock; waiting for it to exit. This kind of problem or error we called as Yum lock issue.
[root@nn ~]# yum install -y nload Loaded plugins: fastestmirror, langpacks Existing lock /var/run/yum.pid: another copy is running as pid 2778. Another app is currently holding the yum lock; waiting for it to exit... The other application is: PackageKit Memory : 332 M RSS (1.6 GB VSZ) Started: Sat Apr 25 16:34:52 2020 - 05:44 ago State : Sleeping, pid: 2778 Another app is currently holding the yum lock; waiting for it to exit... The other application is: PackageKit Memory : 332 M RSS (1.6 GB VSZ) Started: Sat Apr 25 16:34:52 2020 - 05:46 ago State : Sleeping, pid: 2778
In the above example i tried to install a nload package by using YUM from one of my server terminal, immediately i received a message and it is clearly saying another package is installing with help of yum tool right now and you need to wait some more time to exit the first process for unlock of yum tool.
So, here we need to find out which process is running with help of YUM. If you observed the above example in that it clearly mentioned the currently running application/process name Packagekit and PID of that application. with help of this two we can fix the issue.
[root@nn ~]# ps -ef | grep PackageKit root 2778 1769 12 16:34 ? 00:00:55 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none root 5242 3939 0 16:42 pts/0 00:00:00 grep --color=auto PackageKit
[root@nn ~]# ps -ef | grep 2778 root 2778 1769 12 16:34 ? 00:00:55 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py get-updates none root 5195 2778 20 16:42 ? 00:00:05 /usr/bin/python /usr/libexec/urlgrabber-ext-down root 5242 3939 0 16:42 pts/0 00:00:00 grep --color=auto 2778
In the above two example one searched with application name and another one searched with PID. I always suggest search with PID other than application name,becuase with same application with small changes many packages are available on your system, So if you search with PID then you will figure out exact application name.
A GUI PackageKit utility installed in system and is holding the yum lock while running regularly. You can kill the PID to solve the issue. Sometimes this PackageKit won’t stopped even you killed the PID. In that case only solution is to disable PackageKit or remove it completely.
killing the process ID used by PackageKit
Method 1 : Kill the PID by using packageKit application to unhold the yum lock
kill -9 2778
Now try to rerun the yum install -y nload command, after killing the PID also still you facing Another app is currently holding the yum lock; waiting for it to exit issue please follow below methods.
Remove/Disable PackageKit utility
Method 2 : To permanently stop and disabling
PackageKit On CentOS/RHEL 7
# systemctl disable packagekit --now
Method 3 : To permanently Disabling
PackageKit On CentOS/RHEL 6
open below file and change enabled=1 to enabled=0 # vi /etc/yum/pluginconf.d/refresh-packagekit.conf enabled=0
Method 4 : erase PackageKit management utility from system:
yum remove -y PackageKit*
In my case i killed the PID then issue solved,If it is not solved in your case please follow remaining steps.
[root@nn ~]# yum install -y nload Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile * base: mirrors.piconets.webwerks.in * epel: mirrors.bestthaihost.com * extras: mirrors.piconets.webwerks.in * nux-dextop: mirror.li.nux.ro * updates: mirrors.piconets.webwerks.in Resolving Dependencies --> Running transaction check ---> Package nload.x86_64 0:0.7.4-4.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================================== Installing: nload x86_64 0.7.4-4.el7 epel 70 k Transaction Summary ====================================================================================================================================================== Install 1 Package Total download size: 70 k Installed size: 176 k Downloading packages: nload-0.7.4-4.el7.x86_64.rpm | 70 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : nload-0.7.4-4.el7.x86_64 1/1 Verifying : nload-0.7.4-4.el7.x86_64 1/1 Installed: nload.x86_64 0:0.7.4-4.el7 Complete! [root@nn ~]#
By following the above methods you can solve the Another app is currently holding the yum lock; waiting for it to exit Issue in CentOS/Redhat