Ubuntu错误:E: Could not open lock file /var/lib/dpkg/lock-frontend

Ubuntu错误:E: Could not open lock file /var/lib/dpkg/lock-frontend


1、第一种

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?

Ubuntu错误:E: Could not open lock file /var/lib/dpkg/lock-frontend_第1张图片

尝试解决办法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

2、第二种

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

重新apt-get即可!


ends…

你可能感兴趣的:(Linux,ubuntu,linux,运维)