# dpkg-divert --list
diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
local diversion of /sbin/udevadm to /sbin/udevadm.upgrade
diversion of /usr/share/dict/words to /usr/share/dict/words.pre-dictionaries-common by dictionaries-common
diversion of /bin/sh to /bin/sh.distrib by dash

I checked the terminal log files, and everything looks expected: the preinst adds the diversion, the postinst tries to remove it again, but dpkg doesn't like it for some reason.

This seems to be a regression with the new dpkg. If I install new dpkg first, and then udev, things work fine. But if dpkg gets upgraded after udev gets unpacked (and thus the preinst runs with adding the diversion), but before udev gets configured (and the diversion gets removed again), things blow up. I reproduced that in a maverick pbuilder with:

root@donald:/var/cache/apt/archives# dpkg-divert --list
diversion of /usr/share/man/man1/sh.1.gz to /usr/share/man/man1/sh.distrib.1.gz by dash
local diversion of /sbin/udevadm to /sbin/udevadm.upgrade
diversion of /bin/sh to /bin/sh.distrib by dash

We'll fix this in udev. Keeping the dpkg task open as the dpkg changelog says something different than it does:

cjwatson * Use DPKG_MAINTSCRIPT_PACKAGE environment variable as package name o

cjwatson dpkg-divert when no --package or --local options have been specifie

cjwatson although udev seems to use --local explicitly everywhere
pitti hah, reproduced
cjwatson but that does suggest a possible location for the bug
pitti jibel: ok, you can tear down your machine
jibel ok, thanks pitti
cjwatson the code in dpkg-divert looks wrong to me
cjwatson in setpackage:
cjwatson /* If value is NULL we are being called from --local. */
cjwatson opt_pkgname = value;
cjwatson and in main:
cjwatson env_pkgname = getenv("DPKG_MAINTSCRIPT_PACKAGE");
cjwatson if (!opt_pkgname && env_pkgname)
cjwatson setpackage(NULL, env_pkgname);
cjwatson I suggest tracking down Guillem on #debian-dpkg@oftc
cjwatson I *think* the right answer is to replace !opt_pkgname with opt_pkgname_match_any there
pitti I updated the bug with the details; I'll go find him
slangasek current policy forbids use of --local for packages
slangasek seems dpkg now enforces this
cjwatson the changelog does not document that
cjwatson it says:
cjwatson oh, I quoted it above
cjwatson it looks like a dpkg bug regardless of what policy says
slangasek right
cjwatson I agree udev's use of --local is questionable, but it seems easier to fix dpkg-divert in a hurry

* debian/udev.{postinst,postrm,preinst}: Don't use --local diversions, but
--package udev. The former break with current dpkg, as this now enforces
the current policy that maintainer scripts must use --package, not
--local. (LP: #727211)
-- Martin Pitt <email address hidden> Tue, 01 Mar 2011 17:22:08 +0100

* used debootstrap to create a jaunty chroot environment on my jaunty machine.
* used do_release_upgrade to upgrade to karmic
* used do_release_upgrade to upgrade to lucid
* used do_release_upgrade to upgrade to maverick
* used do_release_upgrade to upgrade to natty

and encountered this problem.

If the fix was "released" on 25th of march, I would expect it to be included in Natty that is referenced by this upgrade path.

The do-release-upgrade failed and the workaround mentioned in one of the duplicate bugs: