E: Could not get lock /var/lib/dpkg/lock

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了E: Could not get lock /var/lib/dpkg/lock相关的知识,希望对你有一定的参考价值。

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?

刚装好的ubuntu系统准备更新资源出现了一个这样的问题

技术分享

出现这个问题的原因可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因,可能是上次安装时没正常完成,而导致出现此状况。

解决方法:输入以下命令

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

sudo rm /var/lib/dpkg/lock

之后再安装想装的包,即可解决

技术分享

然后我们再重新试一下更新就没有问题了,如下图所示

技术分享


以上是关于E: Could not get lock /var/lib/dpkg/lock的主要内容,如果未能解决你的问题,请参考以下文章

E:could not get lock /var/lib/dpkg/lock -ope

apt-get update 出现E: Could not get lock /var/lib/apt/lists/lock问题的解决

apt-get update 出现E: Could not get lock /var/lib/apt/lists/lock问题的解决

E: Could not get lock /var/lib/dpkg/lock E: Unable to lock the administration directory (/var/lib/d

E: Could not get lock /var/lib/dpkg/lock E: Unable to lock the administration directory (/var/lib/d

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarly unavailable)