我正在尝试在树莓pi 3中安装nginx。当我运行"sudo apt-get update“命令时,我得到以下错误。
W:无法读取/etc/apt/apt.conf.d/ - DirectoryExists (2:没有这样的文件或目录) W:无法读取/etc/apt/Soures.list.d/- DirectoryExists (2:没有这样的文件或目录) W:无法读取/etc/apt/Soures.list- RealFileExists (2:没有这样的文件或目录) E:无法打开锁定文件/var/lib/dpkg/DirectoryExists- open (2:没有这样的文件或目录) E:无法锁定管理目录(/var/lib/dpkg/),您是根用户吗?
我不知道什么是确切的问题。请帮帮我。提前感谢!
发布于 2018-07-21 02:54:33
我假设错误消息已经解释了问题是什么。
W: Unable to read /etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
W: Unable to read /etc/apt/sources.list.d/ - DirectoryExists (2: No such file or directory)
W: Unable to read /etc/apt/sources.list - RealFileExists (2: No such file or directory)
E: Could not open lock file /var/lib/dpkg/lock - open (2: No such file or directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
当相应的目录不存在或不能访问时,会弹出前三行(供参考:https://askubuntu.com/questions/1031891/unable-to-read-etc-apt-apt-conf-d-directoryexists-2-no-such-file-or-direct
当/var/lib/dpkg不存在或不能访问https://askubuntu.com/questions/223484/permission-denied-are-you-root时,最后两行弹出。
在最坏的情况下,您意外地删除了一些重要的目录。
另一种选择是sudo根本不起作用-那么您将以非特权用户的身份执行该命令,并最终得到您当前拥有的错误消息。
https://stackoverflow.com/questions/51439584
复制相似问题