package udev 166-0ubuntu2 failed to install/upgrade: dpkg-divert: error: mismatch on package

Bug #727211 reported by Jean-Baptiste Lallement
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
dpkg (Ubuntu)
Fix Released
Medium
Unassigned
Natty
Won't Fix
High
Unassigned
udev (Ubuntu)
Fix Released
High
Martin Pitt
Natty
Fix Released
High
Martin Pitt

Bug Description

Binary package hint: udev

ISO Testing: Kubuntu Desktop Upgrade i386/amd64 20110301

Occurred during the upgrade from a fresh and fully up to date 10.10 to 11.04.

Error from the logs:
Setting up udev (166-0ubuntu2) ...
udev start/running, process 11248
dpkg-divert: error: mismatch on package
  when removing `diversion of /sbin/udevadm to /sbin/udevadm.upgrade by udev'
  found `local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 2

ProblemType: Package
DistroRelease: Ubuntu 11.04
Package: udev 166-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.38-5.32-generic 2.6.38-rc6
Uname: Linux 2.6.38-5-generic i686
Architecture: i386
Date: Tue Mar 1 15:57:50 2011
EcryptfsInUse: Yes
ErrorMessage: ErrorMessage: subprocess installed post-installation script returned error exit status 2
MachineType: ASUSTeK Computer Inc. U3SG
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-5-generic root=UUID=75f23f17-3ace-4485-af57-a7318eb6c2ff ro quiet splash vt.handoff=7
SourcePackage: udev
Title: package udev 166-0ubuntu2 failed to install/upgrade: ErrorMessage: subprocess installed post-installation script returned error exit status 2
UpgradeStatus: Upgraded to natty on 2011-02-21 (7 days ago)
dmi.bios.date: 01/28/2008
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 305
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: U3SG
dmi.board.vendor: ASUSTeK Computer Inc.
dmi.board.version: 1.0
dmi.chassis.asset.tag: ATN12345678901234567
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK Computer Inc.
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr305:bd01/28/2008:svnASUSTeKComputerInc.:pnU3SG:pvr1.0:rvnASUSTeKComputerInc.:rnU3SG:rvr1.0:cvnASUSTeKComputerInc.:ct10:cvr1.0:
dmi.product.name: U3SG
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK Computer Inc.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Changed in udev (Ubuntu):
status: New → Triaged
importance: Undecided → High
description: updated
description: updated
tags: added: iso-testing
summary: - package udev 166-0ubuntu2 failed to install/upgrade: ErrorMessage:
- subprocess installed post-installation script returned error exit status
- 2
+ package udev 166-0ubuntu2 failed to install/upgrade: dpkg-divert: error:
+ mismatch on package
Revision history for this message
Martin Pitt (pitti) wrote :

Can't reproduce locally in pbuilder.

From Jean-Baptiste:

# 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

root@ubuntu-VirtualBox:~# ls -l /sbin/udevadm*
-rwxr-xr-x 1 root root 116080 2011-02-24 13:32 /sbin/udevadm.upgrade

Revision history for this message
Martin Pitt (pitti) wrote :

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:

# update apt sources to natty

root@donald:/# apt-get install -d dpkg udev
root@donald:/# cd /var/cache/apt/archives/

root@donald:/var/cache/apt/archives# dpkg --unpack udev_166-0ubuntu2_amd64.deb
(Reading database ... 13308 files and directories currently installed.)
Preparing to replace udev 162-2.2 (using udev_166-0ubuntu2_amd64.deb) ...
Adding 'local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
Unpacking replacement udev ...

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

root@donald:/var/cache/apt/archives# dpkg -i dpkg_1.16.0~ubuntu2_amd64.deb
(Reading database ... 13313 files and directories currently installed.)
Preparing to replace dpkg 1.15.8.4ubuntu3.1 (using dpkg_1.16.0~ubuntu2_amd64.deb) ...
Unpacking replacement dpkg ...
Setting up dpkg (1.16.0~ubuntu2) ...

root@donald:/var/cache/apt/archives# dpkg --configure -a
Setting up udev (166-0ubuntu2) ...
udev start/running, process 955
dpkg-divert: error: mismatch on package
  when removing `diversion of /sbin/udevadm to /sbin/udevadm.upgrade by udev'
  found `local diversion of /sbin/udevadm to /sbin/udevadm.upgrade'
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 udev

affects: udev (Ubuntu Natty) → dpkg (Ubuntu Natty)
Revision history for this message
Martin Pitt (pitti) wrote :

Asked Guillem about whether it is intended that dpkg-divert breaks on local diversions that way now. If so, I'll close the dpkg task and remove the --local in udev.

Changed in udev (Ubuntu Natty):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → High
milestone: none → ubuntu-11.04-beta-1
status: New → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

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

Changed in udev (Ubuntu Natty):
milestone: ubuntu-11.04-beta-1 → natty-alpha-3
status: Triaged → In Progress
Changed in dpkg (Ubuntu Natty):
status: Triaged → Won't Fix
Changed in dpkg (Ubuntu):
importance: High → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udev - 166-0ubuntu3

---------------
udev (166-0ubuntu3) natty; urgency=low

  * 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

Changed in udev (Ubuntu Natty):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :
Changed in dpkg (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Steve Langasek (vorlon) wrote :

This fix was included in dpkg 1.16.0~ubuntu4.

Changed in dpkg (Ubuntu):
assignee: nobody → Steve Langasek (vorlon)
milestone: none → ubuntu-11.04-beta-1
assignee: Steve Langasek (vorlon) → nobody
status: Fix Committed → Fix Released
Revision history for this message
rew (r-e-wolff) wrote :

FYI,

Today I

* 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:

  dpkg-divert --local --rename --divert /sbin/udevadm.upgrade --remove /sbin/udevadm

seems to work, as apt-get update; apt-get dist-upgrade seems to have finished...

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.