刚安装的CentOS 7 准备用yum安装一个ntp时间服务器,出现下面的错误:

[root@localhost ~]# yum install ntp ntpdate -y
已加载插件:fastestmirror, langpacks
/var/run/yum.pid 已被锁定,PID 为 3018 的另一个程序正在运行。
Another app is currently holding the yum lock; waiting for it to exit...
  另一个应用程序是:PackageKit
    内存:124 M RSS (1.0 GB VSZ)
    已启动: Mon Jun  4 14:57:54 2018 - 12:02之前
    状态  :睡眠中,进程ID:3018

解决办法:只需将/var/run/yum.pid删除即可,如 rm -rf /var/run/yum.pid