Could not open lock file/var/lib/dpkg/lock的解决

Posted dayspring

tags:

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

Could not open lock file/var/lib/dpkg/lock的解决

 

在ubuntu系统中利用apt-get install something的时候,有时候会出现无法获得锁的权限问题。这是因为有另外一个进程在占用锁。类似以下的错误提示:

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? 
 

解决办法:

sudo rm -rf /var/lib/dpkg/lock

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

sudo apt-get update

sudo dpkg --configure -a

运行以上四条命令

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

pg启动异常could not open lock file "/tmp/.s.PGSQL.5432.lock":

输入apt-get update时出现Could not open lock file /var/lib/apt/lists/lock - open

ubuntu安装软件提示:Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)(

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

关于Ubuntu中E: Could not get lock /var/lib/dpkg/lock - open的三种解决方案

E: could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporary unavailable) E: Una