无法打开锁定文件 /var/lib/dpkg/lock

无法打开锁定文件 /var/lib/dpkg/lock
E: Some index files failed to download. They have been ignored, or old ones used instead.
E: Could not open lock file /var/lib/dpkg/lock - open (21: Is a directory)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

答案1

您的错误表明这/var/lib/dpkg/lock是一个目录。它应该是一个常规文件,或者根本不存在。看看是否sudo rmdir /var/lib/dpkg/lock可行。(如果失败是因为里面有内容,请将内容移到其他地方,然后删除目录。)

相关内容