当我从应用程序启动器的图标启动软件更新程序时,它崩溃了,从命令行运行它显示了错误是什么:
我从 12.10 开始就遇到这个问题,到 13.10 仍然出现这个问题
max@max-ubuntu:~$ update-manager
Traceback (most recent call last):
File "/usr/bin/update-manager", line 28, in <module>
from gi.repository import Gtk
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 27, in <module>
from ._gi import _API, Repository
ImportError: /usr/lib/x86_64-linux-gnu/libpyglib-gi-2.0-python2.7.so.0: undefined symbol: _Py_ZeroStruct
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 64, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python2.7/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python2.7/dist-packages/apport/packaging_impl.py", line 20, in <module>
import apt
File "/usr/lib/python2.7/dist-packages/apt/__init__.py", line 21, in <module>
import apt_pkg
ImportError: /usr/lib/python2.7/dist-packages/apt_pkg.so: undefined symbol: _Py_ZeroStruct
Original exception was:
Traceback (most recent call last):
File "/usr/bin/update-manager", line 28, in <module>
from gi.repository import Gtk
File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 27, in <module>
from ._gi import _API, Repository
ImportError: /usr/lib/x86_64-linux-gnu/libpyglib-gi-2.0-python2.7.so.0: undefined symbol: _Py_ZeroStruct
max@max-ubuntu:~$
答案1
update-manager
是一个 Python 3 应用程序。但是我怀疑您的PYTHONPATH
包含引用 Python 2 安装的目录。有问题的是,这会导致选择/usr/lib/python2.7/dist-packages
不兼容的 Python 2 版本的软件包。apt
尝试取消设置PYTHONPATH
或运行
PYTHONPATH= update-manager