Running yum, the system prompts Existing lock /var/run/yum.pid: another copy is running as pid 3046
Problem description: After logging in to the system, execute yum install vsftpd, and it will prompt Existing lock /var/run/yum.pid: another copy is running as pid 5048. Sometimes yum can be used normally after 5~10 minutes.
Problem analysis: The main reason is that yum is automatically updating, so running yum again will report this error.
Problem solving: Just turn off the yum update that is being performed, stop the running yum process, or disable the automatic startup of the yum process at boot.
Steps:
stop yum process
[root@localhost ~]# rm -f /var/run/yum.pid
Why is there a yum process executing?
It turns out that the yum automatic update mechanism automatically activates the yum process. Use the following command to stop the automatic update:
[root@localhost ~]# /etc/init.d/yum-updatesd stop
stop yum-updatesd: [OK]
If we don't need the automatic update service, we can delete it directly.
yum remove yum-updatesd
However, after removing the service, subsequent updates are done manually with the following command.
yum update