Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration di

alexander@alexander-virtual-machine:~$ sudo apt-get install -y httpd
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 /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock

 

 

 

 

但是这样不能解决问题:可能还会出现问题,解决方案:

sudo dpkg --configure -a
sudo apt-get update

 


 

 
posted @ 2019-03-13 21:55  a318013800  阅读(93)  评论(0编辑  收藏  举报