Handling an Ubuntu update-notifier Error
update-notifier reports an AttributeError E: Unknown error: “<class ‘AttributeError’>” (module ‘apt_pkg’ has no attribute ‘Error’). Analysis First I found that the service has some scripts under /usr/lib/update-notifier/, and apt-check -> apt_check.py among them is the culprit. In my system, the erroring code looks like this: 1 2 3 4 5 6 7 8 9 10 11 import apt_pkg ... def get_apt_pkg_esm_cache(): ... try: esm_cache = apt_pkg.Cache(progress=None) except apt_pkg.Error: esm_cache = None The apt_pkg.Error attribute does not exist, but according to python-apt Navigation, it should, and: ...