[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#4947: dpkg doesn't handle complex Replaces: situations properly



Package: dpkg
Version: 1.4.0.3

'Erik B. Andersen wrote:'
>
>It was pointed out to me that elvis 2.0-5 conflicts with the old versions
>of elvis, but it does not replace them.  Soooo, I quickly adjusted the
>control file so that it now includes: 
>
>    Replaces: elviscmn, elvisnox, elvisx11
>    Conflicts: elviscmn, elvisnox, elvisx11
>
>I installed both elviscmn and elvisnox, and proceeded to try installing
>the new package.  I expected the old packages to be removed, and the new
>elvis package to replace them.  This is what happened:

Wow, you are good!  A developer who tests before releasing.

>    Dillweed:root% dpkg -i elvis_2.0-6_i386.deb
>    Selecting previously deselected package elvis.
>    dpkg: considering removing elviscmn in favour of elvis ...
>    dpkg: no, cannot remove elviscmn (--auto-deconfigure will help):
>     elvisnox depends on elviscmn
>      elviscmn is to be removed.
>    dpkg: regarding elvis_2.0-6_i386.deb containing elvis:
>     elvis conflicts with elviscmn
>      elviscmn (version 2.0-4) is installed.
>    dpkg: error processing elvis_2.0-6_i386.deb (--install):
>     conflicting packages - not installing elvis
>    Errors were encountered while processing:
>     elvis_2.0-6_i386.deb

Note: dpkg suggested using auto-deconfigure.  Does that resolve the problem?

>So now, I decided that maybe the order in which I list the packages is
>important, so I changed the control file as follows:
>
>     Replaces: elvisnox, elvisx11, elviscmn
>     Conflicts: elvisnox, elvisx11, elviscmn  
>
>And when I tried to install the resulting package, this is what happened:
>
>     Dillweed:root% dpkg -i elvis_2.0-6_i386.deb
>     dpkg: considering removing elvisnox in favour of elvis ...
>     dpkg: yes, will remove elvisnox in favour of elvis.
>     dpkg: regarding elvis_2.0-6_i386.deb containing elvis:
>      elvis conflicts with elviscmn
>       elviscmn (version 2.0-4) is installed.
>     dpkg: error processing elvis_2.0-6_i386.deb (--install):
>      conflicting packages - not installing elvis
>     Errors were encountered while processing:
>      elvis_2.0-6_i386.deb
>
>Is this a bug in dpkg???  If not, what is the RightWay(tm) to do this?  I
>am using dpkg 1.4.0.3

I think because elvisnox and elvisx11 depend upon elviscmn, elviscmn
must be the last one processed.  Maybe dpkg needs additional support
for recursive replaces/conflict dependency resolution?  But still the
uninstalling requires an order!  dpkg should be able to handle this
case.  In fact, I'm posting this to the bug system, so we don't forget
about it.

It's a real catch-22.  If elvisnox or elvisx11 are listed first, their
dependency on elviscmn (which apparently dpkg doesn't yet notice can be
replaced) causes the fatal error.  But when elviscmn is first, the
dependencies of the other two packages (which don't seem to be
scheduled for replacement) cause the fatal error.

The dpkg programmers' manual - chapter 8 "Declaring relationships
between packages" has nothing of significance to add :(

Although several experiments come to mind.  E.g.,
   Replaces: elviscmn, elvisx11, elvisnox
   Conflicts: elvisnox, elvisx11, elviscmn
I can't see any way out of the problem without additional dpkg support.

Unless a workaround can be found, the first order (which inspires dpkg
to suggest --auto-deconfigure) may be best because it offers the user
help to resolve the problem on their own.  Could you verify that dpkg
-iB replaces the old packages correctly?

Sorry, I brought you into this mess, Erik :)

Wait, as a last minute inspiration before I send this:  Would a
"Provides:  elviscmn" solve the problem?  My guess is yes.  ...

-- 
Christopher J. Fearnley            |    Linux/Internet Consulting
cjf@netaxs.com, cjf@onit.net       |    UNIX SIG Leader at PACS
http://www.netaxs.com/~cjf         |    (Philadelphia Area Computer Society)
ftp://ftp.netaxs.com/people/cjf    |    Design Science Revolutionary
"Dare to be Naive" -- Bucky Fuller |    Explorer in Universe

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: