问题描述
执行下列代码的时候报错如下
apt-get update && apt-get -f install
报错信息:
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
解决方法
1.先提权
sudo -s
2.重新执行代码
apt-get update && apt-get -f install
执行结果
可以看到已经正常执行了

在执行apt-getupdate&&apt-get-finstall时遇到权限错误,提示无法打开dpkg的锁文件。解决方法是先使用sudo-s提权,然后再重新运行安装命令,之后命令成功执行。

1181

被折叠的 条评论
为什么被折叠?



