[Touch-packages] [Bug 1974456] Re: regression: apt.postint fails if never previously configured
@seb128 Does this still need additional testing? See comments #11 & #12. -- 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/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: Fix Committed 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 -- 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
[Touch-packages] [Bug 1974456] Re: regression: apt.postint fails if never previously configured
P.S. I have worked around this in my build system (by creating an empty executable script at the location that apt.postinst is expecting before I call dpkg --configure) so I'm not worried. When I reported this I didn't realise it wouldn't affect debootstrap. -- 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/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 -- 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
[Touch-packages] [Bug 1974456] Re: regression: apt.postint fails if never previously configured
> Which tool were you using to bootstrap your system? My own build system (which I wrote about for LWN: https://lwn.net/Articles/821367/ ). -- 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/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 -- 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
[Touch-packages] [Bug 1968154] Re: Only keep 2 kernels
Raised #1974456. -- 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/1968154 Title: Only keep 2 kernels Status in apt package in Ubuntu: Fix Released Status in apt source package in Bionic: Fix Committed Status in apt source package in Focal: Fix Released Status in apt source package in Impish: Fix Released Bug description: [Impact] APT currently keeps 3 kernels or even 4 in some releases. Our boot partition is sized for a steady state of 2 kernels + 1 new one being unpacked, hence users run out of space and new kernels fail to install, upgrade runs might abort in the middle. It's not nice. [Test plan] 1. Have two kernels installed (let's call them version 3, 2) 2. Check that both kernels are not autoremovable 3. Install an old kernel (let's call it 1), and mark it automatic 4. Check that 1 will be autoremovable (apt autoremove -s) 5. Reboot into 1, check that 2 is autoremovable (apt autoremove -s) 6. Actually remove 2 7. Reboot into 3 and check that both 1 and 3 are now not autoremovable [Where problems could occur] We could keep the wrong kernels installed that the user did not expect. We remove the requirement to keep the most recently installed version, previously recorded in APT::LastInstalledKernel, to achieve this, as we had 3 hard requirements so far: 1. keep booted kernel 2. keep highest version 3. keep most recently installed 1 can't be removed as it would break running systems, 2 is what you definitely want to keep. During normal system lifetime, the most recently installed kernel is the same as the highest version, so 2==3, and there are no changes to behavior. Likewise, if you most recently installed an older kernel manually for debugging, it would be manually installed and not subject to removal, even if the rule is dropped. The behavior really only changes if you install an older kernel, and then mark it auto - that older kernel becomes automatically removable immediately after it is marked as auto. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1968154/+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
[Touch-packages] [Bug 1974456] [NEW] regression: apt.postint fails if never previously configured
Public bug reported: #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. ** Affects: apt (Ubuntu) Importance: Undecided Status: New -- 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/1974456 Title: regression: apt.postint fails if never previously configured Status in apt package in Ubuntu: New Bug description: #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 -- 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
[Touch-packages] [Bug 1968154] Re: Only keep 2 kernels
This is causing me trouble 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. I think it's because the patch[1] removes `/etc/kernel/postinst.d/apt- auto-removal`: diff --git a/debian/rules b/debian/rules index 7997739..8a110f7 100755 --- a/debian/rules +++ b/debian/rules @@ -29,7 +29,6 @@ override_dh_install-arch: dh_install -papt -Xmethods/curl -Xmethods/curl+https -Xmethods/curl+http dh_install --remaining install -m 644 debian/apt.conf.autoremove debian/apt/etc/apt/apt.conf.d/01autoremove - install -m 755 debian/apt.auto-removal.sh debian/apt/etc/kernel/postinst.d/apt-auto-removal override_dh_gencontrol: dh_gencontrol -- -Vapt:keyring="$(shell ./vendor/getinfo keyring-package)" ...but `apt.postinst` still contains this: # 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 Since I'm building this from scratch, "$2" (the most-recently- configured-version) is empty, and `dpkg --compare-versions lt` returns true. [1]: https://git.launchpad.net/ubuntu/+source/apt/commit/?id=f9d2d993687c0d5223c241956ef6a0aabcf15bf0 -- 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/1968154 Title: Only keep 2 kernels Status in apt package in Ubuntu: Fix Released Status in apt source package in Bionic: Fix Committed Status in apt source package in Focal: Fix Released Status in apt source package in Impish: Fix Released Bug description: [Impact] APT currently keeps 3 kernels or even 4 in some releases. Our boot partition is sized for a steady state of 2 kernels + 1 new one being unpacked, hence users run out of space and new kernels fail to install, upgrade runs might abort in the middle. It's not nice. [Test plan] 1. Have two kernels installed (let's call them version 3, 2) 2. Check that both kernels are not autoremovable 3. Install an old kernel (let's call it 1), and mark it automatic 4. Check that 1 will be autoremovable (apt autoremove -s) 5. Reboot into 1, check that 2 is autoremovable (apt autoremove -s) 6. Actually remove 2 7. Reboot into 3 and check that both 1 and 3 are now not autoremovable [Where problems could occur] We could keep the wrong kernels installed that the user did not expect. We remove the requirement to keep the most recently installed version, previously recorded in APT::LastInstalledKernel, to achieve this, as we had 3 hard requirements so far: 1. keep booted kernel 2. keep highest version 3. keep most recently installed 1 can't be removed as it would break running systems, 2 is what you definitely want to keep. During normal system lifetime, the most recently installed kernel is the same as the highest version, so 2==3, and there are no changes to behavior. Likewise, if you most recently installed an older kernel manually for debugging, it would be manually installed and not subject to removal, even if the rule is dropped. The behavior really only changes if you install an older kernel, and then mark it auto - that older kernel becomes automatically removable immediately after it is marked as auto. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1968154/+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