Another app is currently holding the yum lock; waiting for it to exit…
Existing lock /var/run/yum.pid: another copy is running as pid …
delete yum.pid
\# rm -f /var/run/yum.pid
Just run yum again
or
kill PID process
\# kill -9 PID
Empty the cache
\# yum clean all
Just run yum again
If there is no pid number in the prompt
Command to view running yum processes
\# ps aux | grep yum
This command will list all yum processes currently running, and display their PID (process ID), user, CPU usage and other information in detail.
Note that in versions after CentOS 7, yum has been replaced by the dnf command, you can replace yum in the command with dnf.
Parameter explanation:
ps aux: Display all processes of all current users, and display detailed information
a: Display all processes, including processes of other users
u: Display process information in a user-oriented format, including the owner and origin of the process time
x : show processes without a controlling terminal
| : take the output of the previous command as input for a later command
grep : match a keyword