在屏幕终止后恢复 do-release-grade

在屏幕终止后恢复 do-release-grade

当我对键盘进行了一些操作后,我正在查看我和维护者版本所更改的配置的差异,结果出现了以下错误:

Configuration file '/etc/bind/named.conf.options'
 ==> File on system created by you or by a script.
 ==> File also in package provided by package maintainer.
   What would you like to do about it ?  Your options are:
    Y or I  : install the package maintainer's version
    N or O  : keep your currently-installed version
      D     : show the differences between the versions
      Z     : start a shell to examine the situation
 The default action is to keep your current version.
*** named.conf.options (Y/I/N/O/D/Z) [default=N] ? -- 0:bionic -- time-stamp -- Jan/09/20 11:52:04 --
-- 0:bionic -- time-stamp -- Jan/09/20 11:56:29 --
D

-
(END)
=== Command terminated with signal 2 (Thu Jan  9 11:57:04 2020) ===

q


Reading cache
q
q^C
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 285, in __getitem__
    return self._weakref[key]
  File "/usr/lib/python3.6/weakref.py", line 137, in __getitem__
    o = self.data[key]()
KeyError: 'libcamitk-dev'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/ubuntu-release-upgrader-k1z7kgfn/bionic", line 8, in <module>
    sys.exit(main())
  File "/tmp/ubuntu-release-upgrader-k1z7kgfn/DistUpgrade/DistUpgradeMain.py", line 235, in main
    save_system_state(logdir)
  File "/tmp/ubuntu-release-upgrader-k1z7kgfn/DistUpgrade/DistUpgradeMain.py", line 128, in save_system_state
    scrub_sources=True)
  File "/tmp/ubuntu-release-upgrader-k1z7kgfn/DistUpgrade/apt_clone.py", line 149, in save_state
    self._write_state_installed_pkgs(sourcedir, tar)
  File "/tmp/ubuntu-release-upgrader-k1z7kgfn/DistUpgrade/apt_clone.py", line 190, in _write_state_installed_pkgs
    for pkg in cache:
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 333, in __iter__
    yield self[pkgname]
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 288, in __getitem__
    rawpkg = self._cache[key]
KeyboardInterrupt

*** Send problem report to the developers?

After the problem report has been sent, please fill out the form in the
automatically opened web browser.

What would you like to do? Your options are:
  S: Send report (98.9 KB)
  V: View report
  K: Keep report file for sending later or copying to somewhere else
  I: Cancel and ignore future crashes of this program version
  C: Cancel
Please choose (S/V/K/I/C): C

=== Command detached from window (Thu Jan  9 11:57:35 2020) ===

我试图重新连接到屏幕,但sudo screen -r显示There is no screen to be resumed.,并sudo screen -ls显示No Sockets found in /run/screen/S-root.

我查找并找到了有关恢复升级的答案,但它们要么适用于仅屏幕分离的情况,要么适用于 dpkg 退出的情况。但我发现 dpkg 仍在进程列表中运行,因此继续运行可能更明智。有什么想法吗?

答案1

我在这里发现了同样的情况:https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1343737同时尝试找到解决方案以某种方式窃取正在运行的 dpkg 的 pty。

我可以dpkg通过 继续这个过程reptyer

  • reptyer手动下载了 deb 文件。它在这里https://ubuntu.pkgs.org/18.04/ubuntu-universe-amd64/reptyr_0.6.2-1.2_amd64.deb.html并使用wget http://archive.ubuntu.com/ubuntu/pool/universe/r/reptyr/reptyr_0.6.2-1.2_amd64.deb下载 deb 文件。

  • 我从中提取了二进制文件,因为 dpkg 文件仍然被运行 锁定dpkg。这是使用ar x reptyr_0.6.2-1.2_amd64.deb

  • 在里面,data.tar.gz 被提取出来,然后在新的usr/bin文件夹里面有一个名为的文件reptyer

  • 更改权限以允许执行此文件,sudo chmod +x reptyer

  • 最后使用命令附加到设置reptyer -T <pid of dpkg>,可以使用 找到 pid htop,并搜索 dpkg 进程。瞧!:) 我再次进入升级会话并能够继续!

答案2

我有同样的问题,我按照这个步骤解决了

  1. 杀死dpkg进程,参考无法锁定管理目录(/var/lib/dpkg/),是否有另一个进程正在使用它?
  2. 运行“dpkg --configure -a”,这将重新配置已终止的 do-release-upgrade 进程

相关内容