我无法访问完全权限并且终端总是显示以下消息。
alex@debian:/$ apt-get update
Reading package lists... Done
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/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
请指教。谢谢!
答案1
你好,我遇到了同样的问题:
我安装 Debian:
我创建了一个用户 debian,并将其添加到 root 组:
debian@03-:~$ groups debian
debian : debian root sudo
我尝试更新:
debian@03-:~$ sudo apt-get update
-bash: sudo: command not found
debian@03-:~$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
请问有人能知道我做错了什么吗?
答案2
您需要使用sudo
来获得提升的权限,或者以 root 身份登录(通常不推荐,除非您知道自己在做什么)。
尝试使用sudo apt-get update
。
当您说您无法访问完全权限时,如果您的意思是系统管理员不允许sudo
或以 root 身份登录,则需要让他们运行更新。