在新安装系统的服务器中,我们使用Yum安装库,有时会提示被占用,我们该怎么处理呢?

Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
Memory : 23 M RSS (414 MB VSZ)
Started: Tue Mar 12 08:44:00 2024 - 1:20:21 ago
State : Traced/Stopped, pid: 8258

这个其实就是Yum被占用了(被锁了),我们可以在系统中结束掉yum的进程。

rm -f /var/run/yum.pid

Centos重启yum:

/sbin/service yum-updatesd restart

fedora重启yum:

systemctl status yum-updatesd.service

然后去执行yum命令,会发现可以正常运行了。