E: Unable to lock the administration directory (/var/lib/dpkg/)

使用apt-get进行软件的install或update时,有时会出现以下提示信息:
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

原因是有可能有其他的apt-get进程在活动。
解决办法,把apt-get进程找出来,杀死!
ps -ef | grep apt
sudo kill -9 <PID>

也有人说使用以下命令:

  sudo rm /var/lib/dpkg/lock
  sudo dpkg --configure -a

但是,请小心,非常危险,可能会导致操作系统无法启动。(之前我执行了第一个命令,没有执行第二个,导致操作系统无法启动,启动报内核错误)

我第二次遇到这个问题时准备尝试第一个方法,结果不小心系统重启了,而重启完这个问题消失了。

扫描二维码关注公众号,回复: 225987 查看本文章

https://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process

https://stackoverflow.com/questions/18682233/cant-remove-any-existing-lock

http://blog.163.com/cobyeah@126/blog/static/140137653201142354756503/

猜你喜欢

转载自bnmnba.iteye.com/blog/2375513
今日推荐