当我尝试安装 VIM 时出现此错误:
sandy@sandy-Rev-1-0:~$ sudo apt-get update
[sudo] password for sandy:
E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
E: Unable to lock directory /var/lib/apt/lists/
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
答案1
如果另一个包管理器程序正在运行并锁定了 apt 打包系统,则会出现该错误。APT 一次只能由一个程序管理,它不是为了允许并发访问 APT 数据库而设计的。
要解决此问题,请运行命令fuser -v /var/lib/dpkg/lock
以获取持有锁的程序。请先关闭该程序,然后重试。
br