Ubuntu错误:E: Could not open lock file /var/lib/dpkg/lock-frontend
ubuntu使用apt下载和更新软件的时候,出现了以下错误:
E: Could not open lock file /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?
尝试解决办法1:消息已经提示了,are you root ?
,所以可以尝试将命令加sudo
。
尝试解决办法2:依次输入以下命令
sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates}
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
sudo apt-get download dpkg
sudo dpkg -i dpkg*.deb
sudo apt-get download base-files
sudo dpkg -i base-files*.deb
sudo apt-get update
sudo apt-get check
ends…