W: APT had planned for dpkg to do more than it reported back

Bug #1647638 reported by Rico Tzschichholz on 2016-12-06
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Low
Unassigned

Bug Description

I noticed that base-files was not completely installed and meant to fix it with "sudo apt-get install --reinstall base-files". This resulted in the following output.

$ LANG=C sudo apt-get install --reinstall base-files
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.9.0-4 linux-headers-4.9.0-4-generic linux-image-4.9.0-4-generic linux-image-extra-4.9.0-4-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 13 not upgraded.
Need to get 0 B/56,9 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 598721 files and directories currently installed.)
Preparing to unpack .../base-files_9.6ubuntu8_amd64.deb ...
Unpacking base-files (9.6ubuntu8) over (9.6ubuntu8) ...
Setting up base-files (9.6ubuntu8) ...
Processing triggers for install-info (6.3.0.dfsg.1-1) ...
Processing triggers for cracklib-runtime (2.9.2-3) ...
Processing triggers for plymouth-theme-ubuntu-gnome-text (16.10.5) ...
update-initramfs: deferring update (trigger activated)
Processing triggers for man-db (2.7.5-2) ...
Processing triggers for initramfs-tools (0.125ubuntu8) ...
update-initramfs: Generating /boot/initrd.img-4.9.0-8-generic
W: APT had planned for dpkg to do more than it reported back (4 vs 6).
   Affected packages: base-files:amd64

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Zesty Zapus (development branch)
Release: 17.04
Codename: zesty

Rico Tzschichholz (ricotz) wrote :
Download full text (12.4 KiB)

/var/log/apt/eipp.log.xz:
Request: EIPP 0.1
Architecture: amd64
Architectures: amd64 i386
ReInstall: base-files:amd64
Planner: internal
...
Package: base-files
Architecture: amd64
Version: 9.6ubuntu8
APT-ID: 97386
Essential: yes
Multi-Arch: foreign
Status: triggers-awaited
Pre-Depends: awk
Breaks: initscripts (<< 2.88dsf-13.3), sendfile (<< 2.1b.20080616-5.2~)
...

---

$ LANG=C sudo apt-get install -o Debug::pkgOrderList=1 -o Debug::pkgPackageManager=1 -o Debug::pkgDpkgPm=1 --reinstall base-files
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-4.9.0-4 linux-headers-4.9.0-4-generic linux-image-4.9.0-4-generic linux-image-extra-4.9.0-4-generic
Use 'sudo apt autoremove' to remove them.
CreateOrderList(): Adding Immediate flag for perl-base:amd64
  ImmediateAdd(): Adding Immediate flag to libc6:amd64 < 2.24-7ubuntu2 @ii mK > cause of PreDepends perl-base:amd64
    ImmediateAdd(): Adding Immediate flag to libgcc1:amd64 < 1:6.2.1-5ubuntu2 @ii mK > cause of Depends libc6:amd64
      ImmediateAdd(): Adding Immediate flag to gcc-6-base:amd64 < 6.2.1-5ubuntu2 @ii mK > cause of Depends libgcc1:amd64
  ImmediateAdd(): Adding Immediate flag to dpkg:amd64 < 1.18.10ubuntu1 @ii mK > cause of PreDepends perl-base:amd64
    ImmediateAdd(): Adding Immediate flag to libbz2-1.0:amd64 < 1.0.6-8build1 @ii mK > cause of PreDepends dpkg:amd64
    ImmediateAdd(): Adding Immediate flag to liblzma5:amd64 < 5.2.2-1.2 @ii mK > cause of PreDepends dpkg:amd64
    ImmediateAdd(): Adding Immediate flag to libselinux1:amd64 < 2.6-3 @ii mK > cause of PreDepends dpkg:amd64
      ImmediateAdd(): Adding Immediate flag to libpcre3:amd64 < 2:8.39-2 @ii mK > cause of Depends libselinux1:amd64
        ImmediateAdd(): Adding Immediate flag to multiarch-support:amd64 < 2.24-7ubuntu2 @ii mK > cause of PreDepends libpcre3:amd64
    ImmediateAdd(): Adding Immediate flag to zlib1g:amd64 < 1:1.2.8.dfsg-2ubuntu5 @ii mK > cause of PreDepends dpkg:amd64
    ImmediateAdd(): Adding Immediate flag to tar:amd64 < 1.29b-1.1 @ii mK > cause of PreDepends dpkg:amd64
      ImmediateAdd(): Adding Immediate flag to libacl1:amd64 < 2.2.52-3 @ii mK > cause of PreDepends tar:amd64
        ImmediateAdd(): Adding Immediate flag to libattr1:amd64 < 1:2.4.47-2 @ii mK > cause of Depends libacl1:amd64
CreateOrderList(): Adding Immediate flag for perl-base:i386
CreateOrderList(): Adding Immediate flag for init-system-helpers:amd64
CreateOrderList(): Adding Immediate flag for diffutils:amd64
CreateOrderList(): Adding Immediate flag for diffutils:i386
CreateOrderList(): Adding Immediate flag for sysvinit-utils:amd64
  ImmediateAdd(): Adding Immediate flag to util-linux:amd64 < 2.29-1ubuntu2 @ii mK > cause of Depends sysvinit-utils:amd64
    ImmediateAdd(): Adding Immediate flag to libblkid1:amd64 < 2.29-1ubuntu2 @ii mK > cause of PreDepends util-linux:amd64
      ImmediateAdd(): Adding Immediate flag to libuuid1:amd64 < 2.29-1ubuntu2 @ii mK > cause of Depends libblkid1:amd64
        ImmediateAdd(): Adding Immediate flag to passwd:amd64 < 1:4.2-3.2ubuntu1 @ii mK > cause of De...

Adolfo Jayme (fitojb) on 2016-12-16
Changed in apt (Ubuntu):
importance: Undecided → Medium
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in apt (Ubuntu):
status: New → Confirmed
tags: added: zesty
tags: added: rls-z-incoming
tags: added: rls-aa-incoming
removed: rls-z-incoming
Brian Murray (brian-murray) wrote :

I went looking through foundations team package bug reports with this same error message and only found one:

[ 10:39AM 10167 ] [ bdmurray@impulse:/misc/bug-attach ]
 $ for atlog in $(find . -name VarLogDistupgradeApttermlog.gz); do zgrep "APT had planned for dpkg to do more than it reported back" $atlog; done
[ 10:43AM 10168 ] [ bdmurray@impulse:/misc/bug-attach ]
 $ grep -r "APT had planned for dpkg to do more than it reported back" *
apt/bug-1647638/Description.txt:W: APT had planned for dpkg to do more than it reported back (4 vs 6).
debconf/bug-1696989/Description.txt:W: APT had planned for dpkg to do more than it reported back (40 vs 44).

Tiago Stürmer Daitx (tdaitx) wrote :

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

exit 1
EOF

$ sudo apt-get --reinstall install linux-image-$(uname -r)
$ sudo sed -i 's:exit 1:exit 0:' /etc/kernel/postinst.d/zz-fail
$ 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:
$ 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

The last one is my own custom script.

Tiago Stürmer Daitx (tdaitx) wrote :

Small correction to get the right zz-fail file (needs to escape $), please run:

$ 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

Julian Andres Klode (juliank) wrote :

That's just a minor cosmetic issue IMO. It does not affect the functionality at all. There's just a mismatch between what apt thought dpkg would do and what dpkg actually did, because dpkg took some shortcuts.

Julian Andres Klode (juliank) wrote :

Downgrading as per my last comment.

Changed in apt (Ubuntu):
importance: Medium → Low
tags: removed: rls-aa-incoming
Jan Smith (johsmi9933) wrote :

I think this bug caused the upgrade from 7.04 to 7.10 fail on my system, telling me that the system may be in an unstable state. Really annoying.

Balint Reczey (rbalint) wrote :

I started observing the issue in autopkgtest of unattended-upgrades and place a workaround in LP: #1781446

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers