E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

E:Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

在Ubuntu系统里用sudo apt-get install …时

遇到错误:

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 pkill apt

解决方法二(如果方法一不行):

更新apt

sudo apt-get install update

解决方法三(如果法二也不行)

强制解锁

sduo rm /var/lib/dpkg/lock

猜你喜欢

转载自blog.csdn.net/weixin_39536859/article/details/106657673