[Bug 1974456] Re: regression: apt.postint fails if never previously configured

Julian Andres Klode 1974456 at bugs.launchpad.net
Mon May 23 11:32:33 UTC 2022


@David I was able to reproduce this with mmdebstrap as it uses -updates
pocket, but not with debootstrap as it only uses the release pockets.
Which tool were you using to bootstrap your system?

It's possible we might just want keep the fix in -proposed and not
release it to updates if it does not affect the supported bootstrapping
tools.

** Description changed:

+ [Impact]
+ bootstrapping a system with apt that fixes #1968154 fails in focal and bionic, as they try to execute the config file that is being removed.
+ 
+ This is not a problem on updates, only on new installs, so impact is
+ limited to bootstrapping tools that enable -updates, such as mmdebstrap.
+ 
+ [Test case]
+ 
+ bootstrapping with -updates enabled can easily be tested with
+ mmdebstrap:
+ 
+ mmdebstrap -v focal ~/Projects/Ubuntu/Scratch/focal
+ 
+ for example, on focal:
+ 
+ Setting up apt (2.0.8) ...
+ /var/lib/dpkg/info/apt.postinst: 65: /etc/kernel/postinst.d/apt-auto-removal: not found
+ dpkg: error processing package apt (--configure):
+  installed apt package post-installation script subprocess returned error exit status 127
+ 
+ [Regression potential]
+ We remove 5 lines from the shell postinst script, there could be syntax errors? But then we'd see those during upgrades, so practically none.
+ 
+ [Original bug report]
  #1968154 removed `/etc/kernel/postinst.d/apt-auto-removal` in this patch:
  https://git.launchpad.net/ubuntu/+source/apt/commit/?id=f9d2d993687c0d5223c241956ef6a0aabcf15bf0
  
  ...but `apt.postinst` still tries to run it:
  
-     # create kernel autoremoval blacklist on update
-     if dpkg --compare-versions "$2" lt 0.9.9.3; then
-         /etc/kernel/postinst.d/apt-auto-removal
-     fi
+     # create kernel autoremoval blacklist on update
+     if dpkg --compare-versions "$2" lt 0.9.9.3; then
+         /etc/kernel/postinst.d/apt-auto-removal
+     fi
  
  If I understand correctly, "$2" is the most-recently-configured-version,
  and if it's empty `dpkg --compare-versions lt` will evaluate to true.
  
  This fails when I'm building a focal (20.04) userspace from scratch:
  
-     $ dpkg --configure -a
-     [...]
-     Setting up apt (2.0.8) ...
-     /var/lib/dpkg/info/apt.postinst: 65: /etc/kernel/postinst.d/apt-auto-removal: not found
-     dpkg: error processing package apt (--configure):
-      installed apt package post-installation script subprocess returned error exit status 127
+     $ dpkg --configure -a
+     [...]
+     Setting up apt (2.0.8) ...
+     /var/lib/dpkg/info/apt.postinst: 65: /etc/kernel/postinst.d/apt-auto-removal: not found
+     dpkg: error processing package apt (--configure):
+      installed apt package post-installation script subprocess returned error exit status 127
  
  It works with apt 2.0.6.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apt in Ubuntu.
https://bugs.launchpad.net/bugs/1974456

Title:
  regression: apt.postint fails if never previously configured

Status in apt package in Ubuntu:
  Confirmed
Status in apt source package in Bionic:
  Confirmed
Status in apt source package in Focal:
  Confirmed

Bug description:
  [Impact]
  bootstrapping a system with apt that fixes #1968154 fails in focal and bionic, as they try to execute the config file that is being removed.

  This is not a problem on updates, only on new installs, so impact is
  limited to bootstrapping tools that enable -updates, such as
  mmdebstrap.

  [Test case]

  bootstrapping with -updates enabled can easily be tested with
  mmdebstrap:

  mmdebstrap -v focal ~/Projects/Ubuntu/Scratch/focal

  for example, on focal:

  Setting up apt (2.0.8) ...
  /var/lib/dpkg/info/apt.postinst: 65: /etc/kernel/postinst.d/apt-auto-removal: not found
  dpkg: error processing package apt (--configure):
   installed apt package post-installation script subprocess returned error exit status 127

  [Regression potential]
  We remove 5 lines from the shell postinst script, there could be syntax errors? But then we'd see those during upgrades, so practically none.

  [Original bug report]
  #1968154 removed `/etc/kernel/postinst.d/apt-auto-removal` in this patch:
  https://git.launchpad.net/ubuntu/+source/apt/commit/?id=f9d2d993687c0d5223c241956ef6a0aabcf15bf0

  ...but `apt.postinst` still tries to run it:

      # create kernel autoremoval blacklist on update
      if dpkg --compare-versions "$2" lt 0.9.9.3; then
          /etc/kernel/postinst.d/apt-auto-removal
      fi

  If I understand correctly, "$2" is the most-recently-configured-
  version, and if it's empty `dpkg --compare-versions lt` will evaluate
  to true.

  This fails when I'm building a focal (20.04) userspace from scratch:

      $ dpkg --configure -a
      [...]
      Setting up apt (2.0.8) ...
      /var/lib/dpkg/info/apt.postinst: 65: /etc/kernel/postinst.d/apt-auto-removal: not found
      dpkg: error processing package apt (--configure):
       installed apt package post-installation script subprocess returned error exit status 127

  It works with apt 2.0.6.

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




More information about the foundations-bugs mailing list