【已解决】ubuntu18.10 sudo apt install 安装报错 无法打开锁文件 /var/lib/dpkg/lock-frontend Unable to acquire the dpkg frontend lock
在ubuntu18.10使用sudo进行安装文件时报错
报错情况一.E: No such file or directory are you root?
E: 无法打开锁文件 /var/lib/dpkg/lock-frontend - open (2:No such file or directory)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates} sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status apt-get download dpkg sudo dpkg -i dpkg*.deb apt-get download base-files sudo dpkg -i base-files*.deb sudo apt-get update sudo apt-get check
-----------------------------------
E: 无法打开锁文件 /var/lib/dpkg/lock-frontend - open (2: 没有那个文件或目录) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
https://blog.51cto.com/u_15127545/4188285
报错情况二.E: 11: Resource temporarily unavailable
is another process using it?
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?
sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/lib/dpkg/lock sudo rm /var/cache/apt/archives/lock
-----------------------------------
都运行一遍,具体也不知道哪条起了作用。
解决apt-get /var/lib/dpkg/lock-frontend 问题 - 北麓牧羊人的文章 - 知乎 https://zhuanlan.zhihu.com/p/126538251