Debian Bug report logs - #4947
dpkg doesn't handle complex Replaces: situations properly

version graph

Package: dpkg; Maintainer for dpkg is Dpkg Developers <debian-dpkg@lists.debian.org>; Source for dpkg is src:dpkg (PTS, buildd, popcon).

Reported by: Chris Fearnley <cjf@netaxs.com>

Date: Fri, 25 Oct 1996 06:03:05 UTC

Severity: normal

Merged with 7692, 10573, 32635

Found in versions 1.4.0.17, 1.4.0.33

Done: Christoph Martin <martin@uni-mainz.de>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-devel@lists.debian.org, andersee@et.byu.edu (Erik B. Andersen), Ian Jackson <ian@chiark.greenend.org.uk>:
Bug#4947; Package dpkg. (full text, mbox, link).


Acknowledgement sent to Chris Fearnley <cjf@netaxs.com>:
New bug report received and forwarded. Copy sent to andersee@et.byu.edu (Erik B. Andersen), Ian Jackson <ian@chiark.greenend.org.uk>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Chris Fearnley <cjf@netaxs.com>
To: submit@bugs.debian.org
Subject: dpkg doesn't handle complex Replaces: situations properly
Date: Fri, 25 Oct 1996 01:40:28 -0400 (EDT)
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


Information forwarded to debian-devel@lists.debian.org:
Bug#4947; Package dpkg. (full text, mbox, link).


Acknowledgement sent to Ian Jackson <ian@chiark.greenend.org.uk>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #10 received at 4947@bugs.debian.org (full text, mbox, reply):

From: Ian Jackson <ian@chiark.greenend.org.uk>
To: 4947@bugs.debian.org
Subject: Re: Bug#4947: dpkg doesn't handle complex Replaces properly
Date: Tue, 29 Oct 96 15:16 GMT
Re the problem with Elvis.  Unfortunately dpkg can only handle
removing one package at the same time as installing one.

This is hard to fix, and certainly cannot be done for Debian 1.2.

I suggest the following workaround: have elvis Conflict only with
elviscmn and use Replaces on all three to get the files in
elvis{x11,nox} removed without complaint.

--auto-deconfigure (which is passed by dselect) will cause elvisx11
and elvisnox to be marked unconfigured if the new elvis doesn't
provide elviscmn, and in any case dselect will hopefully have marked
them to remove in any case.

When this has been done to elvis and tested please reassign the bug to
dpkg.

Thanks,
Ian.


Information forwarded to Klee Dienes and Ian Jackson <dpkg-maint@chiark.greenend.org.uk>:
Bug#4947; Package dpkg. (full text, mbox, link).


Acknowledgement sent to remco@blaakmeer.student.utwente.nl (Remco Blaakmeer):
Extra info received and forwarded to maintainer. Copy sent to Klee Dienes and Ian Jackson <dpkg-maint@chiark.greenend.org.uk>. (full text, mbox, link).


Message #15 received at 4947-maintonly@bugs.debian.org (full text, mbox, reply):

From: remco@blaakmeer.student.utwente.nl (Remco Blaakmeer)
To: 4947-maintonly@bugs.debian.org
Subject: Old bugs need to be looked at
Date: Sun, 1 Feb 1998 12:23:59 +0100 (CET)
This is an automated message sent to all bugs older than one year.

This bug is very old. Please take a look at it and see if you can fix it.
If it has already been fixed, please close it.

If you have problems fixing it or if you don't have the time to fix it,
please ask the people on debian-devel@lists.debian.org for help, so that
at least the oldest bugs can be solved before Debian 2.0 is released.

Remco Blaakmeer


Merged 4947 10573. Request was from Ben Collins <bmc@marcus.seva.net> to control@bugs.debian.org. (full text, mbox, link).


Severity set to `normal'. Request was from Ben Collins <bcollins@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Merged 4947 7692 10573. Request was from Ben Collins <bcollins@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Merged 4947 7692 10573 32635. Request was from Ben Collins <bcollins@debian.org> to control@bugs.debian.org. (full text, mbox, link).


Bug closed, send any further explanations to Christoph Martin <martin@uni-mainz.de> Request was from Christoph Martin <martin@uni-mainz.de> to control@bugs.debian.org. (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 25 19:22:47 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.