Tips: 本文创建于2013年11月20日,已超过 2 年,内容或图片可能已经失效!

debian的apt-get有时会出现这样的异常

apt-error

出现异常的原因是系统已经在运行了一个apt-get进程,如果不是自己运行的,而且没有风险,那就杀掉他

解决办法

sudo rm /var/cache/apt/archives/lock  
sudo rm /var/lib/dpkg/lock

这个问题和redhat系列的yum是一样的,有时yum会出现这样的异常

Existing lock /var/run/yum.pid: another copy is running as pid 3807.  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  
Another app is currently holding the yum lock; waiting for it to exit…  

同样的,也是应为系统在运行了一个yum

解决办法

rm -rf /var/run/yum.pid