Apt-get 卡住,等待响应

Apt-get 卡住,等待响应

我通过 SSH 连接启动了该命令apt full-upgrade,然后我的会话超时了,并且 apt 仍然挂在这里(term.log):

*** sudoers (Y/I/N/O/D/Z) [default=N] ?

所以我需要做出回应,这样它才能继续。

我上线了Ubuntu 14.04

我应该怎么办 ?

编辑

当我启动时,apt-get autoclean我得到:

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?

编辑2

lsof /var/lib/dpkg/lock
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/124/gvfs
      Output information may be incomplete.
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF   NODE NAME
dpkg    3409 root    3uW  REG    9,1        0 791425 /var/lib/dpkg/lock

编辑3 输出pstree -psa 3409

init,1
  └─sudo,26185 apt full-upgrade
      └─apt,26186 full-upgrade
          └─dpkg,3409 --status-fd 84 --configure perl:amd64 perl-modules:all libperl5.18:amd64 libc-dev-bin:amd64 linux-libc-dev:amd64 libc6-dev:amd64 libc6-dbg:amd64 libapt-inst1.5:amd64 libexpat1:amd64 libexpat1-dev:amd64 ...

答案1

为了将来参考,我已经通过停止 dpkg 来解决这个问题:

sudo rm -rf /var/lib/dpkg/lock

然后 :

apt-get update

我收到一条消息,例如 dpkg 已停止,您要恢复吗?我输入了“是”,一切正常。

相关内容