5

I was just viewing a diff of configs changed by me and the maintainer's version when I did something wrong with my keyboard because following error occured:

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) ===

I was trying to reattach to screen, but sudo screen -r says There is no screen to be resumed., and sudo screen -ls says No Sockets found in /run/screen/S-root..

I was looking and found answers about resuming upgrade, but they either apply to cases when only screen was detached or to cases when dpkg exited. But I see dpkg is still running in process list so it may be wiser to continue somehow. Any ideas?

cly
  • 261
  • 2
  • 7

2 Answers2

11

I found same looking situation here: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1343737 while tryed to find solution to steal somehow the running dpkg's pty.

I was able to continue the dpkg process via reptyer!

  • I downloaded reptyer deb file by hand. It's found here https://ubuntu.pkgs.org/18.04/ubuntu-universe-amd64/reptyr_0.6.2-1.2_amd64.deb.html and using wget http://archive.ubuntu.com/ubuntu/pool/universe/r/reptyr/reptyr_0.6.2-1.2_amd64.deb to download the deb file.

  • I extracted the binary from it, because dpkg files were still locked by running dpkg. This is done using ar x reptyr_0.6.2-1.2_amd64.deb

  • Inside, data.tar.gz is extracted, then inside the new usr/bin folder was a file called reptyer.

  • Change permissions to allow execution of this file, sudo chmod +x reptyer

  • Finally attach to the setup using reptyer -T <pid of dpkg> command, where the pid can be found using htop, and searching for the dpkg process. And voilá! :) I was inside my upgrade session again and was able to continue!

Zanna
  • 70,465
cly
  • 261
  • 2
  • 7
1

I have the same problem like that, I do this steps and solved

  1. Kill the dpkg process, refer to Unable to lock the administration directory (/var/lib/dpkg/) is another process using it?
  2. Run 'dpkg --configure -a', this will reconfigure terminated process of do-release-upgrade