apt-check fails with "The cache has no package named 'skype-bin'"

Bug #1361768 reported by Jason Conti on 2014-08-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)

Bug Description

I noticed today that I hadn't received any update notifications for a while, and after following the trail found in the output of /usr/lib/update-notifier/apt-check:

E: Unknown Error: '<class 'KeyError'>' ("The cache has no package named 'skype-bin'")

Removing the exception hook from that file we find the actual error:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 198, in __getitem__
    return self._weakref[key]
  File "/usr/lib/python3.4/weakref.py", line 125, in __getitem__
    o = self.data[key]()
KeyError: 'skype-bin'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./apt-check", line 201, in <module>
  File "./apt-check", line 136, in run
    ignored = ul._is_ignored_phased_update(aptcache[pkg.name])
  File "/usr/lib/python3/dist-packages/apt/cache.py", line 205, in __getitem__
    raise KeyError('The cache has no package named %r' % key)
KeyError: "The cache has no package named 'skype-bin'"

This occurs when checking for phased updates, it tries to index the apt.Cache with the package name from the apt_pkg.Cache. But since the arch is amd64 and not i386, the package in the apt.Cache is instead skype-bin:i386.

If we replace:

ignored = ul._is_ignored_phased_update(aptcache[pkg.name])


ignored = ul._is_ignored_phased_update(aptcache[pkg.get_fullname(False)])

Everything seems to work fine.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: update-notifier 0.154.1

Uname: Linux x86_64
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: Unity
Date: Tue Aug 26 13:06:28 2014
InstallationDate: Installed on 2011-10-11 (1049 days ago)
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111011)
SourcePackage: update-notifier
UpgradeStatus: Upgraded to trusty on 2014-04-21 (126 days ago)

Jason Conti (jconti) wrote :
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers