passing already installed package to software-center causes conflict message

Bug #829138 reported by Tim Lunn
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

in testing the fix to Bug #824692, I noticed that software-center does not appear to handle the situation where you pass it .deb file that is already installed correctly.

say you have package-vX.deb which has already been installed on the system.

and you now run 'software-center package-vX.deb' and when it loads up you get this message

"Breaks existing package 'package-vX' conflict: package-vX ( )"

Now I would expect that running the above command in this case should land you on the same page that you get if you navigate through the 'installed software' pages to that package.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: software-center 4.1.14 [modified: usr/share/software-center/softwarecenter/db/__init__.py usr/share/software-center/softwarecenter/db/application.py]
ProcVersionSignature: Ubuntu 3.0.0-8.11-generic 3.0.1
Uname: Linux 3.0.0-8-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
Date: Fri Aug 19 11:56:06 2011
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110803.1)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: software-center
UpgradeStatus: Upgraded to oneiric on 2011-08-13 (6 days ago)

Related branches

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

Thanks for your bugreport.

What package did you experience this problem with? I just checked with the (super simple) 2vcard and there I get a correct "Reinstall" prompt.

Changed in software-center (Ubuntu):
status: New → Incomplete
Revision history for this message
Tim Lunn (darkxst) wrote :

It was with this initially

http://synergy.googlecode.com/files/synergy-1.4.3-Linux-x86_64.deb

I also tried with a few random packages from /var/cache/apt and got the same message.

Revision history for this message
Tim Lunn (darkxst) wrote :

I agree 2vcard does get the correct 'reinstall' prompt but nothing else seems to?

I just tried these following packages from the apt cache, all come up with the conflict message, rather than the reinstall message

gnome-shell
gnome-accessibilty-theme
apport-gtk
zeitgeist-extension-fts

Revision history for this message
Tim Lunn (darkxst) wrote : Re: [Bug 829138] Re: passing already installed package to software-center causes conflict message

so I believe this problem occurs with any package that has a dependency set to conflict with itself. Which is the vast majority of packages.

for example for gnome-shell, you have

Conflicts: gnome-shell

Revision history for this message
Tim Lunn (darkxst) wrote :

This is actually a bug in apt.debfile (from python.apt package)

def _check_single_pkg_conflict(self, pkgname, ver, oper):
        """Return True if a pkg conflicts with a real installed/marked pkg."""
        # FIXME: deal with conflicts against its own provides
        # (e.g. Provides: ftp-server, Conflicts: ftp-server)

Revision history for this message
Tim Lunn (darkxst) wrote :

here is a patch that fixes the bug In python-apt.

I will also re-assign this bug to python-apt, since software-center is just playing the messenger here, and passing on the error message from apt.debfile.

affects: software-center (Ubuntu) → python-apt (Ubuntu)
Changed in python-apt (Ubuntu):
status: Incomplete → Confirmed
Tim Lunn (darkxst)
tags: added: patch
Revision history for this message
Alexey Feldgendler (feldgendler) wrote :

Internally, python-apt uses libapt-pkg, which for each package that has neither "Architecture: all" nor "MultiArch: same" properties generates a synthetic confclit with its own versions for other architectures. I.e. gnome-shell for amd64 conflicts with gnome-shell for i386, and vice versa, which makes sense.

However, python-apt fails to take architecture-specific conflicts (such as gnome-shell for amd64 conflicting with gnome-shell for i386) into account, and instead interprets them as plain conflicts of a package with itself.

I believe the attached python-apt.fix2.patch is a superficial fix that doesn't fix the real problem but happens to fix its symptom. I'll make another fix.

Revision history for this message
Alexey Feldgendler (feldgendler) wrote :

Added a merge request for lp:~feldgendler/python-apt/829138 with my version of a fix.

I was confused by the presence of both lp:python-apt and lp:ubuntu/python-apt and unsure where to request merging of my fix. I chose the latter, was it right?

Revision history for this message
Brian Murray (brian-murray) wrote :

It looks to me like python-apt is a mirror of Debian's code. You can see this by following the lp:python-apt link above, so ubuntu/python-apt is the right branch.

Revision history for this message
Alexey Feldgendler (feldgendler) wrote :

OK then. I suppose there is a process by which fixes in Ubuntu's mirror are routinely submitted upstream.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.8.3ubuntu1

---------------
python-apt (0.8.3ubuntu1) precise; urgency=low

  * merged from debian/sid

python-apt (0.8.3) unstable; urgency=low

  [ Alexey Feldgendler ]
  * handle architecture-specific conflicts correctly (LP: #829138)

  [ Michael Vogt ]
  * lp:~mvo/python-apt/debfile-multiarch:
    - add multiarch support to the debfile.py code (LP: #854839)
  * tests/test_apt_cache.py:
    - add additional check if provides test can actually be run

python-apt (0.8.2) unstable; urgency=low

  [ Michael Vogt ]
  * merged from ubuntu:
    - use logging instead of print
    - update distro template Ubuntu.info.in
    - add xz compression support
  * po/python-apt.pot:
    - refreshed
  * po/pt_BR.po:
    - updated, thanks to Sergio Cipolla (closes: #628398)
  * po/da.po:
    - updated, thanks to Joe Dalton (closes: #631309)
  * po/sr.po:
    - updated, thanks to Nikola Nenadic (closes: #638308)
  * python/apt_pkgmodule.cc:
    - add apt_pkg.get_architectures() call
  * apt/cache.py:
    - remove "print" when creating dirs in apt.Cache(rootdir=dir),
      thanks to Martin Pitt
    - add __lt__ to apt.Package so that sort() sorts by name
      on list of package objects
  * debian/control:
    - add recommends to xz-lzma to ensure we have the unlzma command
  * apt/cache.py:
    - set Dir::bin::dpkg if a alternate rootdir is given
      (LP: #885895)
  * build fixes for the apt in experimental
  * apt/debfile.py:
    - raise error when accessing require_changes and
      missing_deps without calling check() before, thanks to
      Tshepang Lekhonkhobe (closes: #624379)
  * apt/package.py:
    - add new "suggests" property, thanks to Christop Groth
    - allow Dependency object to be iteratable, this allows to write
      code like:
      for or_dep_group in pkg.candidate.dependencies:
          for dep in or_dep_group:
              do_something()
      (thanks to Christop Groth)
  * apt/progress/base.py:
    - write exception text to stderr to avoid hidding exceptions
      like "pre-configure failed" from libapt (thanks to Jean-Baptiste
      Lallement)

  [ Tshepang Lekhonkhobe ]
  * rm usage of camelcase in cache.py doc (closes: #626617)
  * grammar fix in the cache.py doc (closes: #626610)

  [ Nikola Pavlović ]
  * fixed a typo, changed "Open Source software" to
    "free and open-source software" (LP: #500940)
 -- Michael Vogt <email address hidden> Thu, 08 Dec 2011 20:44:30 +0100

Changed in python-apt (Ubuntu):
status: Confirmed → Fix Released
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.