Unable to acquire the dpkg frontend lock

当运行sudo apt-get install/update/其余命令时,会出现以下提示:linux

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?ubuntu

出现这个问题的缘由多是:frontend

在ubuntu系统的termial下,用apt-get install 安装软件的时候,若是在未完成下载的状况下将terminal close。此时 apt-get进程可能没有结束。结果,若是再次运行apt-get install 命令安装软件时,出现如上错误。即有另外一个程序正在占用apt-get install进程,因为它在运行时,会占用软件源更新时的系统锁(简称‘系统更新锁’),此时资源被锁。ui

咱们只须要杀死以前的进程,释放系统锁就能够了:spa

ps -A|grep apt
显示code

921 ? 00:00:01 apt
而后执行blog

sudo kill 921
————————————————
ps -A 显示全部进程,进程

grep apt 查找包含字符apt的进程资源

wczlinux@ubuntu:~/test$ sudo apt install gcc
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?
wczlinux@ubuntu:~/test$ ps -A|grep apt
   921 ?        00:00:00 apt.systemd.dai
   961 ?        00:00:00 apt.systemd.dai
wczlinux@ubuntu:~/test$ sudo kill 921
wczlinux@ubuntu:~/test$ sudo kill 961
kill: (961): No such process
wczlinux@ubuntu:~/test$ gcc
相关文章
相关标签/搜索