问题:
root@in2:/home# apt-get install git
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?
解决方案:
1.root@in:/home# ps -A |grep apt
4019 pts/12 00:00:03 apt-get
root@in:/home# kill -9 4019
root@in:/home# sudo apt-get install mplayer
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
root@in:/home# dpkg --configure -a
2.报错原因其实这是因为有另外一个程序在运行,导致锁不可用。原因可能是上次运行更新或安装没有正常完成。解决办法是杀死此进程。
PS -A |grep apt 无显示进程
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
可能还会出现问题,解决方案:
sudo dpkg --configure -a
sudo apt-get update
问题:
dpkg: error: dpkg frontend is locked by another process
原因是包管理器没有正确关闭。需要重启计算机或者重新打开终端 输入:
sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a