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:
| |
The apt_pkg.Error attribute does not exist, but according to python-apt Navigation, it should, and:
It inherits from
SystemError, so make sure to catch this class first.
And apt_pkg is a dynamic library:
| |
Presumably it is a version problem, so let me reinstall it:
| |
No effect, so I edited the file directly:
| |
Done.