Linux常见错误:Could not get lock /var/lib/dpkg/lock-frontend - open

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?

你是否遇到这种错误提示?无论是CentOS还是Debian还是Ubuntu(上面的是Debian和Ubuntu)

在你使用 yum update 或 yum install xxxx,还是 apt update 或 apt install xxxx 在更新或安装时出现某种中断就会出现这种提示,出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,进而出现此状况,解决的办法其实很简单:kill 掉 yum 或 apt 进程

pkill -9 yum

pkill -9 apt

至于有的教程让你删除提示出现的那个,比如这里的 rm -rf /var/lib/dpkg/lock-frontend ,这当然也是可行的,不过问题只是 yum 或 apt 无故中断,kill 掉进程就可以了。

你可能感兴趣的:(Linux常见错误:Could not get lock /var/lib/dpkg/lock-frontend - open)