当运行sudo apt-get install/update/其他命令时,会出现如下提示:
E: 无法获得锁 /var/lib/dpkg/lock-frontend - open (11: 资源暂时不可用) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?本人出现的现象如下:
fanbi@ubuntu:~$/ sudo apt install npm E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?出现这个问题的原因可能是:
在ubuntu系统的termial下,用apt-get install 安装软件的时候,如果在未完成下载的情况下将terminal close。此时 apt-get进程可能没有结束。结果,如果再次运行apt-get install 命令安装软件时,出现如上错误。即有另一个程序正在占用apt-get install进程,由于它在运行时,会占用软件源更新时的系统锁(简称‘系统更新锁’),此时资源被锁。
所以,第一种方法,我们只需要杀死之前的进程,释放系统锁就可以了:
ps -e|grep apt-get显示
6965 ? 00:00:01 apt-get然后执行
sudo kill 6965第二种方法,强制解锁
sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock————————————————版权声明:本文为博主「CLAY-Z」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。原文链接:https://blog.csdn.net/qq_38019633/article/details/84024309
转载于:https://www.cnblogs.com/fanbi/p/11506555.html
相关资源:JAVA上百实例源码以及开源项目