通过sudo apt-get install xxx 安装软件时报错:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1823 (unattended-upgr)
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
这表明当前有某个进程正在apt-get,导致资源被锁不可用。资源被锁的原因可能是上次运行安装或更新时没有正常完成。
解决方法很简单:
sudo rm /var/lib/dpkg/lock-frontend
you can delete the lock file with the following command:
sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
来源参考:
https://blog.csdn.net/newcong0123/article/details/109331845
https://askubuntu.com/questions/15433/unable-to-lock-the-administration-directory-var-lib-dpkg-is-another-process