gdebi ignores Replaces directive in case of Conflict

Bug #146398 reported by Francois Gouget
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Triaged
Medium
Michael Vogt

Bug Description

Binary package hint: gdebi

I have encountered this problem with the CrossOver Office (http://www.codeweavers.com/products/cxoffice/) packages. They come in multiple flavors, but only one can be installed at a given time. The more capable flavors use the 'Replaces' directive to smoothly 'upgrade' the less capable ones.This works fine with dpkg, but gdebi instead gives me an error as if the Replaces directive was not there (this directive is described in section 7.5.2 of the Debian Policy Manual).

I have reproduced the situation with dummy packages so you have all the details. You can get them there:
 * source (1.4KB)
   http://fgouget.free.fr/tmp/gdebi/foo-packages.tar.gz
 * basic package (1.2KB)
   http://fgouget.free.fr/tmp/gdebi/foo_1.0.0-1_i386.deb
 * sophisticated package (1.2KB)
   http://fgouget.free.fr/tmp/gdebi/foo-pro_1.0.0-1_i386.deb

Here is how to reproduce the problem:

$ sudo gdebi foo_1.0.0-1_i386.deb
Reading package lists: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
Package for testing gdebi's Replaces support
 This is the package to be replaced by the more 'sophisticated' version.
Do you want to install the software package? [y/N]:y
Selecting previously deselected package foo.
(Reading database ... 151236 files and directories currently installed.)
Unpacking foo (from foo_1.0.0-1_i386.deb) ...
Setting up foo (1.0.0-1) ...

$ sudo gdebi foo-pro_1.0.0-1_i386.deb
Reading package lists: Done
Reading state information: Done
Reading state information: Done
Reading state information: Done
This package is uninstallable
Conflicts with the installed package 'foo'

So gdebi does not want to replace the foo package with foo-pro. I think it should maybe warn the user but still allow him to proceed. With dpkg there is no issue:

$ dpkg -i foo-pro_1.0.0-1_i386.deb
Selecting previously deselected package foo-pro.
dpkg: considering removing foo in favour of foo-pro ...
dpkg: yes, will remove foo in favour of foo-pro.
(Reading database ... 151239 files and directories currently installed.)
Unpacking foo-pro (from foo-pro_1.0.0-1_i386.deb) ...
Setting up foo-pro (1.0.0-1) ...

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport and your very good test case. This will not make it into gutsy unfortunately but I tagged it "later" so that it gets looked at right after the release.

Thanks,
 Michael

Changed in gdebi:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

A fix for this is in my bzr tree and will be part of the next upload. It works with your two test debs, thanks for provding them. If you are curious, please use:
$ bzr get http://bazaar.launchpad.net/%7Eubuntu-core-dev/gdebi/ubuntu/
and run ./gdebi and let me know if the fix works for you too.

Thanks,
 Michael

Changed in gdebi:
assignee: nobody → mvo
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdebi - 0.3.5

---------------
gdebi (0.3.5) hardy; urgency=low

  [ Michael Vogt ]
  * GDebi/DebPackage.py:
    - support lzma packages
  * gdebi-gtk:
    - run gtk.init_check()
  * GDebi/DebPackage.py:
    - properly support Replaces (LP: #146398)

  [ Daniel Hahler ]
  * properly handle packages that conflict with their own provides.
    Fixes LP: #141126.

 -- Michael Vogt <email address hidden> Mon, 03 Mar 2008 15:39:11 +0100

Changed in gdebi:
status: Fix Committed → Fix Released
Revision history for this message
Francois Gouget (fgouget) wrote :

I've just tested it in Ubuntu 8.04 and it works.
Thanks!

Revision history for this message
Francois Gouget (fgouget) wrote :

This bug is back. It is present at least in:
 * gdebi 0.8.1 on Ubuntu 11.10
 * gdebi 0.6.3ubuntu1 on Linux Mint 10

Changed in gdebi (Ubuntu):
status: Fix Released → New
Revision history for this message
Francois Gouget (fgouget) wrote :

One more note: the test packages I provided initially are still present and can still be used to reproduce this bug.

Changed in gdebi (Ubuntu):
status: New → Triaged
Changed in gdebi (Ubuntu):
milestone: later → none
Revision history for this message
Brian Murray (brian-murray) wrote :

I was able to recreate this on precise.

tags: added: regression-release
Revision history for this message
Michael Vogt (mvo) wrote :

I pushed a branch with a (failing) test case for this to:
 lp:~mvo/python-apt/improve-replace-handling

affects: gdebi (Ubuntu) → python-apt (Ubuntu)
tags: added: apt.debfile
Revision history for this message
Julian Andres Klode (juliank) wrote :

I want to add that Replaces does not indicate that one package replaces another package, or is better. It just says that a package may replace files of the other package. It does not have any meaning dependency solving wise.

Of course, in the case of gdebi it might make sense to treat it as having such a meaning, if used together with an unversioned conflicts.

Stella (claudia-muetzel)
description: updated
Revision history for this message
Francois Gouget (fgouget) wrote :

This 12+ years old bug is still present in gdebi 0.9.5.7 (as shipped in Ubuntu 16.10 to the current 20.04 and Debian 10 for instance).

Given that gdebi 0.9.5.7 was released in 2015 I have to ask the question:
Is gdebi still maintained?

Revision history for this message
Francois Gouget (fgouget) wrote :

Here is an updated foo-packages.tar.gz file to reproduce this issue.
The updates mostly deal with changes in Debian policy such as adding debian/compat and updating DH_COMPAT. The new foo-packages.tar.gz also contains pre-built packages which you are free to use or delete and rebuild.

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

Other bug subscribers

Remote bug watches

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