gdebi crashes with : KeyError: "The cache has no package named 'opera-next'" when package is not in the archive

Bug #800865 reported by Adolfo Jayme Barrientos
64
This bug affects 7 people
Affects Status Importance Assigned to Milestone
gdebi (Ubuntu)
Fix Released
High
Unassigned

Bug Description

I downloaded a .deb package from internet. After trying to open it with GDebi to install it, GDebi window opens and loads it. When the progress bar completely fills, GDebi window closes unexpectly.

TEST CASE:
1. Download opera-next
 $ wget http://deb.opera.com/opera-beta/pool/non-free/o/opera-next/opera-next_11.50.1052_i386.deb
2. Run gdebi
 $ gdebi-gtk opera-next/opera-next_11.50.1052_i386.deb

Results:
 Traceback (most recent call last):
   File "/usr/bin/gdebi-gtk", line 73, in <module>
     app = GDebi(datadir=data,options=options,file=afile)
   File "/usr/share/gdebi/GDebi/GDebi.py", line 148, in __init__
     self.open(file)
   File "/usr/share/gdebi/GDebi/GDebi.py", line 327, in open
     provides = self.compareProvides()
   File "/usr/share/gdebi/GDebi/GDebiCommon.py", line 129, in compareProvides
     pkg = self._cache[self._deb.pkgname].installed
   File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 177, in __getitem__
     raise KeyError('The cache has no package named %r' % key)
 KeyError: "The cache has no package named 'opera-next'"

It is also reproducible with other known good .deb files that are not part of the archive, for example crossover pro.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: gdebi 0.8~exp2
ProcVersionSignature: Ubuntu 3.0-1.2-generic 3.0.0-rc3
Uname: Linux 3.0-1-generic i686
NonfreeKernelModules: wl
Architecture: i386
Date: Wed Jun 22 14:24:13 2011
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=es_MX:en
 PATH=(custom, no user)
 LANG=es_MX
 LC_MESSAGES=es_MX.UTF-8
 SHELL=/bin/bash
SourcePackage: gdebi
UpgradeStatus: Upgraded to oneiric on 2011-06-17 (5 days ago)

Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :
Revision history for this message
Adolfo Jayme Barrientos (fitojb) wrote :

Well, this only happens with (maybe faulty) package: opera-next_11.50.1027_i386.deb. But GDebi should give an error message and then quit...

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.

Here is the trace:
 Traceback (most recent call last):
   File "/usr/bin/gdebi-gtk", line 73, in <module>
     app = GDebi(datadir=data,options=options,file=afile)
   File "/usr/share/gdebi/GDebi/GDebi.py", line 148, in __init__
     self.open(file)
   File "/usr/share/gdebi/GDebi/GDebi.py", line 327, in open
     provides = self.compareProvides()
   File "/usr/share/gdebi/GDebi/GDebiCommon.py", line 129, in compareProvides
     pkg = self._cache[self._deb.pkgname].installed
   File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 177, in __getitem__
     raise KeyError('The cache has no package named %r' % key)
 KeyError: "The cache has no package named 'opera-next'"

Changed in gdebi (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
description: updated
Changed in gdebi (Ubuntu):
importance: Medium → High
summary: - GDebi immediately closes after finishing loading a .deb package
+ gdebi crashes with : KeyError: "The cache has no package named 'opera-
+ next'" when package is not in the archive
Revision history for this message
Luca Falavigna (dktrkranz) wrote :
Changed in gdebi (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gdebi - 0.8.0

---------------
gdebi (0.8.0) unstable; urgency=low

  * Upload to unstable.
  * GDebi/GDebiCommon.py:
    - Handle exception generated when installing packages not available
      in any archive (LP: #800865).
  * data/gdebi.desktop.in, data/gdebi-kde.desktop.in:
    - Remove NoDisplay to show GDebi in system menus (LP: #803729).
 -- Luca Falavigna <email address hidden> Thu, 07 Jul 2011 23:22:28 +0000

Changed in gdebi (Ubuntu):
status: Fix Committed → Fix Released
tags: added: testcase
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.