当我尝试下载新软件或更新(在终端中)时出现这些错误......
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - setupAPTPartialDirectory (1: Operation not permitted)
E: Could not open lock file /var/lib/apt/lists/lock - open (13: permission denied)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not lock the file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
这真让我抓狂!任何帮助我都会非常感激。我是 Linux 新手。提前谢谢您!
答案1
要运行诸如apt-get update
或 之类的操作apt-get install
,甚至使用dpkg -i
etc 的操作(我假设您正在运行其中一个或类似命令),您需要使用sudo
root 权限来运行这些命令。出于安全原因,普通用户没有此类权限,但可以使用 root 权限来获取这些权限,以便执行特定命令。
要运行命令,只需sudo
将其放在开头,例如:
sudo apt-get update