bionic, 1.6.14 is good too.

root@b:~# python3 a.py
WAITING
^C
root@b:~# apt install libapt-pkg5.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfreetype6
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
  apt apt-utils
Suggested packages:
  apt-doc aptitude | synaptic | wajig dpkg-dev
The following packages will be upgraded:
  apt apt-utils libapt-pkg5.0
3 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
Need to get 2224 kB of archives.
After this operation, 16.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 libapt-pkg5.0 
amd64 1.6.14 [809 kB]
Get:2 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 apt amd64 
1.6.14 [1207 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-proposed/main amd64 apt-utils 
amd64 1.6.14 [209 kB]
Fetched 2224 kB in 0s (7775 kB/s) 
(Reading database ... 28937 files and directories currently installed.)
Preparing to unpack .../libapt-pkg5.0_1.6.14_amd64.deb ...
Unpacking libapt-pkg5.0:amd64 (1.6.14) over (1.6.13) ...
Setting up libapt-pkg5.0:amd64 (1.6.14) ...
(Reading database ... 28937 files and directories currently installed.)
Preparing to unpack .../archives/apt_1.6.14_amd64.deb ...
Unpacking apt (1.6.14) over (1.6.13) ...
Setting up apt (1.6.14) ...
(Reading database ... 28937 files and directories currently installed.)
Preparing to unpack .../apt-utils_1.6.14_amd64.deb ...
Unpacking apt-utils (1.6.14) over (1.6.13) ...
Setting up apt-utils (1.6.14) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
root@b:~# python3 a.py
WAITING
^CSeen KeyboardInterrupt()
END

do-release-upgrade was fine too:
Upgrading
Fetched 0 B in 0s (0 B/s)                                                       
                                                                                
                                                                                
                                           

Restoring original system state


Note that if you Ctrl+C while it's downloading the upgrades, it gets the 
keyboardinterrupt in the wrong spot - inside the progress handler and does not 
restore the correct state, probably should be a different bug, though.

** Tags removed: verification-needed verification-needed-bionic
** Tags added: verification-done verification-done-bionic

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1898026

Title:
  interruption of dist-upgrade can leave you next release in
  sources.list

Status in apt package in Ubuntu:
  Fix Released
Status in ubuntu-release-upgrader package in Ubuntu:
  Fix Released
Status in apt source package in Bionic:
  Fix Committed
Status in ubuntu-release-upgrader source package in Bionic:
  New
Status in apt source package in Focal:
  Fix Committed
Status in ubuntu-release-upgrader source package in Focal:
  Fix Released
Status in apt source package in Groovy:
  Fix Released
Status in ubuntu-release-upgrader source package in Groovy:
  Fix Released
Status in apt source package in Hirsute:
  Fix Released
Status in ubuntu-release-upgrader source package in Hirsute:
  Fix Released

Bug description:
  [Impact]
  Calling update() or installing packages from apt clients resets their SIGINT 
and SIGQUIT handlers to SIG_DFL, overriding any signal handlers they might have 
set for them.

  In case of ubuntu-release-upgrader, this results in the release
  upgrader being unable to handle interrupts after it did the initial
  update - the default libc handler will run and the program exits.

  [Test plan]

  [[apt]]
  As a standalone test for apt, we can test the following script:

  import apt
  import time

  apt.Cache().update()
  print("WAITING")
  try:
      time.sleep(10000)
  except BaseException as e:
      print("Seen", repr(e))
  print("END")

  Pressing Ctrl+C while WAITING is printed should print Seen
  KeyboardInterrupt, and importantly, also the END line.

  [[ubuntu-release-upgrader]]
  1) On an Ubuntu 18.04 system run do-release-upgrade in a terminal.
  2) At the "Do you want to start the upgrade?" question say Y.
  3) When you see the "Lock screen disabled" message you will also see 
"Inhibiting until Ctrl+C is pressed".
  4) Press "Ctrl+C"

  Your /etc/apt/sources.list file will now have focal in it instead of
  bionic although the upgrade has quit. With the version of ubuntu-
  release-upgrader in -proposed you will not see the "Ctrl+C" message.
  For your sources.list file to be restored you'll need the version of
  apt from bionic-proposed installed before starting the upgrade.

  [Where problems could occur]
  apt: This specific change removes the two lines that SIG_DFL the signal 
handlers after running scripts. AFAWCT those lines are unnecessary - the code 
that calls it temporarily sets the handlers to SIG_IGN but restores previous 
handlers at the end; it was wrongly refactored decades ago. A regression could 
occur in that those signals will now continue to be ignored if we missed a spot.

  ubuntu-release-upgrader: The change is wrapping a bunch of code in a
  try: except: block so if the indentation was off the pyflakes /
  pycodestyle tests would fail but autopkgtest will catch that.

  [Original bug report]
  As a long-time-user of ?ubuntu, with apt-get as tool of choice for 
updates/upgrades I wrote a daily script for updates, with 'dist-upgrade'.
  In all earlier years, it wouldn't actually do an upgrade of a ?ubuntu 
version; just all packages including new ones. Version updates had to be 
initiated manually, and I was always asked if I really wanted the new ?ubuntu 
version. Sounds appropriate.

  Last night when it (dist-upgrade), it just gave me 20.04. No questions asked. 
I for one consider this kind of intrusive, though.
  It *might* have to make with me trying 'sudo do-release-upgrade -m desktop' a 
number of times earlier; just to *check* if the upgrade was on offer; but this 
is only a guess.

  In *any* case, a pop-up asking "Are you sure? Are you connected
  through an adequate pipe? Are you sitting with full batteries; better
  a power supply?" would be convenient; since I am using my PC for
  urgent duties, and didn't want to fiddle with unexpected upgrade bugs.

  ProblemType: BugDistroRelease: Ubuntu 20.04
  Package: ubuntu-release-upgrader-core 1:20.04.25
  ProcVersionSignature: Ubuntu 5.4.0-48.52-generic 5.4.60
  Uname: Linux 5.4.0-48-generic x86_64
  ApportVersion: 2.20.11-0ubuntu27.9
  Architecture: amd64
  CasperMD5CheckResult: skip
  CrashDB: ubuntu
  CurrentDesktop: KDE
  Date: Thu Oct  1 11:48:39 2020
  InstallationDate: Installed on 2019-03-14 (566 days ago)
  InstallationMedia: Kubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 
(20180725)
  PackageArchitecture: allSourcePackage: ubuntu-release-upgrader
  Symptom: ubuntu-release-upgrader
  UpgradeStatus: Upgraded to focal on 2020-09-29 (1 days ago)
  VarLogDistupgradeAptlog:
   Log time: 2020-09-29 19:44:28.696289
   Log time: 2020-09-29 19:44:33.573481

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1898026/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to