I could replicate it on my system, I got the following message on the tests:
W: APT had planned for dpkg to do more than it reported back (0 vs 4).
Affected packages: linux-image-4.10.0-22-generic:amd64
== Reproducer ==
$ sudo tee /etc/kernel/postinst.d/zz-fail <<EOF
#!/bin/sh -e
# Avoid running multiple times
if [ -n "$DEB_MAINT_PARAMS" ]; then
eval set -- "$DEB_MAINT_PARAMS"
if [ -z "$1" ] || [ "$1" != "configure" ]; then
exit 0
fi
fi
To get a clearer log, run 'apt-get upgrade' before trying the reproducer, otherwise apt output might be clobbered by other package installs - the warning should still be there though, just with different numbers.
There might be additional interaction between other scripts in my /etc/kernel/postinst.d directory. I have the following installed:
$ dpkg -S $(find /etc/kernel/postinst.d/)
update-notifier-common, apt, unattended-upgrades, dkms, initramfs-tools, grub-legacy-ec2, grub-pc, sicherboot: /etc/kernel/postinst.d
initramfs-tools: /etc/kernel/postinst.d/initramfs-tools
apt: /etc/kernel/postinst.d/apt-auto-removal
grub-pc: /etc/kernel/postinst.d/zz-update-grub
update-notifier-common: /etc/kernel/postinst.d/update-notifier
grub-legacy-ec2: /etc/kernel/postinst.d/x-grub-legacy-ec2
unattended-upgrades: /etc/kernel/postinst.d/unattended-upgrades
dkms: /etc/kernel/postinst.d/dkms
diversion by sicherboot from: /etc/kernel/postinst.d/dracut
diversion by sicherboot to: /etc/kernel/postinst.d/dracut.SecureBoot
sicherboot: /etc/kernel/postinst.d/dracut
dpkg-query: no path found matching pattern /etc/kernel/postinst.d/zz-update-bootctl
I could replicate it on my system, I got the following message on the tests:
W: APT had planned for dpkg to do more than it reported back (0 vs 4). 4.10.0- 22-generic: amd64
Affected packages: linux-image-
== Reproducer ==
$ sudo tee /etc/kernel/ postinst. d/zz-fail <<EOF
#!/bin/sh -e
# Avoid running multiple times
if [ -n "$DEB_MAINT_PARAMS" ]; then
eval set -- "$DEB_MAINT_PARAMS"
if [ -z "$1" ] || [ "$1" != "configure" ]; then
exit 0
fi
fi
exit 1
EOF
$ sudo apt-get --reinstall install linux-image-$(uname -r) postinst. d/zz-fail
$ sudo sed -i 's:exit 1:exit 0:' /etc/kernel/
$ sudo apt-get upgrade
== Notes ==
To get a clearer log, run 'apt-get upgrade' before trying the reproducer, otherwise apt output might be clobbered by other package installs - the warning should still be there though, just with different numbers.
There might be additional interaction between other scripts in my /etc/kernel/ postinst. d directory. I have the following installed: postinst. d/) notifier- common, apt, unattended- upgrades, dkms, initramfs-tools, grub-legacy-ec2, grub-pc, sicherboot: /etc/kernel/ postinst. d postinst. d/initramfs- tools postinst. d/apt-auto- removal postinst. d/zz-update- grub notifier- common: /etc/kernel/ postinst. d/update- notifier postinst. d/x-grub- legacy- ec2 upgrades: /etc/kernel/ postinst. d/unattended- upgrades postinst. d/dkms postinst. d/dracut postinst. d/dracut. SecureBoot postinst. d/dracut postinst. d/zz-update- bootctl
$ dpkg -S $(find /etc/kernel/
update-
initramfs-tools: /etc/kernel/
apt: /etc/kernel/
grub-pc: /etc/kernel/
update-
grub-legacy-ec2: /etc/kernel/
unattended-
dkms: /etc/kernel/
diversion by sicherboot from: /etc/kernel/
diversion by sicherboot to: /etc/kernel/
sicherboot: /etc/kernel/
dpkg-query: no path found matching pattern /etc/kernel/
The last one is my own custom script.