in this case, one should not “return to the process” (which is very difficult in practice), but “kill” it.
E: Unable to access lock file / var / lib / apt / lists / lock - open (11: Resource temporarily unavailable)
The identifier of the process that established the lock on the file can be recognized by various means. Napimer:
$ sudo fuser /var/lib/apt/lists/lock /var/lib/apt/lists/lock: 5153
or:
$ sudo lsof -w /var/lib/apt/lists/lock COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apt 5153 root 4uW REG 8,1 0 131230 /var/lib/apt/lists/lock
in the example, this is process with ID 5153 . it can be "killed":
$ sudo kill -9 5153
after that, all locks set by this process will be removed.
>>Как вернутся к процессу после обрыва ssh соединения?<<: generally speaking, no, there are some hacking tools (like rediscovering file descriptors to another terminal via gdb), but they are not for everyday use ... installscreenortmuxand use them much more adequate option ... Judging by the conclusion, problem X can be solved simply by killing the hanging shell and / or apt; or wait until it is done by sshd (depending on the settings). - Fat-Zersudo dpkg --configure -a. After that, restart apt update (inside the screen, so as not to repeat the procedure) - jfs