关于yum lock

关于yum lock  
今天在使用yum 的时候遇到了一个问题,我先是remove 了mysql 数据库,然后打算重新安装。 出现了下面的提示。
[root@zeng ~]# yum install mysql
Loaded plugins: fastestmirror, refresh-packagekit
Existing lock /var/run/yum.pid: another copy is running as pid 2678.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: PackageKit
    Memory :  30 M RSS ( 43 MB VSZ)
    Started: Tue May  8 02:59:33 2012 - 00:09 ago
    State  : Uninterruptible, pid: 2678
查看是什么进程hold the yum lock。
[root@zeng ~]# ps aux|grep yum
root      2678 39.4  7.3 104060 88496 ?        S    02:59   0:33 /usr/bin/python /usr/share/PackageKit/helpers/yum/yumBackend.py update-system yes
root      2693  0.0  0.0   4308   756 pts/0    S+   03:00   0:00 grep yum
有三种方式(可能还有其他)一种是等,网络上看到一个例子说等了2天还没有释放。 第二种是重启系统,这对于服务器来说可不是好消息。第三种是kill 掉,不过这种方式 有点风险,可能会导致yum 不可用,因为伤害到rpm database。 我现在选择 kill 掉那个持有yum lock 的锁。
[root@zeng ~]# kill -9 2678
[root@zeng ~]# ps aux|grep yum
root      2722  0.0  0.0   4308   756 pts/0    S+   03:02   0:00 grep yum
还好没有出现异常。如果出现异常可以重启系统这样yum又可以正常使用了,或者可以 试试restart yum 服务(这种方法没试过)。
[root@zeng ~]# yum list gcc
Freeing read locks for locker 0x41e0: 2678/3079218880
Freeing read locks for locker 0x41e2: 2678/3079218880
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * base: mirror01.idc.hinet.net
 * extras: mirror01.idc.hinet.net
 * updates: mirror01.idc.hinet.net
Installed Packages
gcc.i686                                                                  4.4.6-3.el6                                                                   @base

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26110315/viewspace-722935/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/26110315/viewspace-722935/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值