我无法在 UBUNTU 16.04 LTS 中打开软件中心和软件更新程序。顶部栏上还显示一个带有 - 符号的红色圆圈。请帮我解决错误!
prateek@Home-Alone:~$ software-properties-gtk
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 32, in <module>
import aptsources
File "/usr/lib/python3/dist-packages/aptsources/__init__.py", line 3, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 32, in <module>
import aptsources
File "/usr/lib/python3/dist-packages/aptsources/__init__.py", line 3, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
还,
prateek@Home-Alone:~$ update-manager
/usr/bin/update-manager:28: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk
Traceback (most recent call last):
File "/usr/bin/update-manager", line 38, in <module>
from UpdateManager.UpdateManager import UpdateManager
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 36, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 30, in <module>
import apport.fileutils
File "/usr/lib/python3/dist-packages/apport/fileutils.py", line 23, in <module>
from apport.packaging_impl import impl as packaging
File "/usr/lib/python3/dist-packages/apport/packaging_impl.py", line 23, in <module>
import apt
File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
Original exception was:
Traceback (most recent call last):
File "/usr/bin/update-manager", line 38, in <module>
from UpdateManager.UpdateManager import UpdateManager
File "/usr/lib/python3/dist-packages/UpdateManager/UpdateManager.py", line 36, in <module>
import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'
打开软件中心时:
prateek@Home-Alone:~$ software-center
/usr/bin/software-center:25: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, GObject
/usr/share/software-center/softwarecenter/ui/gtk3/views/purchaseview.py:29: PyGIWarning: WebKit2 was imported without specifying a version first. Use gi.require_version('WebKit2', '4.0') before import to ensure that the right version gets loaded.
from gi.repository import WebKit2 as webkit
2018-10-24 18:12:03,053 - softwarecenter.backend.zeitgeist_logger - WARNING - Support for Zeitgeist disabled
/usr/share/software-center/softwarecenter/ui/gtk3/widgets/symbolic_icons.py:23: PyGIWarning: PangoCairo was imported without specifying a version first. Use gi.require_version('PangoCairo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk, GLib, PangoCairo
2018-10-24 18:12:03,128 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2018-10-24 18:12:03,132 - softwarecenter.db.database - ERROR - failed to add apt-xapian-index
Traceback (most recent call last):
File "/usr/share/software-center/softwarecenter/db/database.py", line 193, in _get_new_xapiandb
softwarecenter.paths.APT_XAPIAN_INDEX_DB_PATH)
File "/usr/lib/python2.7/dist-packages/xapian/__init__.py", line 3660, in __init__
_xapian.Database_swiginit(self,_xapian.new_Database(*args))
DatabaseOpeningError: Couldn't stat '/var/lib/apt-xapian-index/index' (No such file or directory)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 607, in msg_reply_handler
*message.get_args_list()))
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 69, in error_cb
callback('')
File "/usr/share/software-center/softwarecenter/backend/installbackend_impl/aptd.py", line 166, in _register_active_transactions_watch
apt_daemon = client.get_aptdaemon(bus=bus)
File "/usr/lib/python2.7/dist-packages/aptdaemon/client.py", line 1701, in get_aptdaemon
False),
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
2018-10-24 18:12:04,189 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
2018-10-24 18:12:04,191 - softwarecenter.plugin - INFO - activating plugin '<module 'webapps_activation' from '/usr/share/software-center/softwarecenter/plugins/webapps_activation.pyc'>'
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 607, in msg_reply_handler
*message.get_args_list()))
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 69, in error_cb
callback('')
File "/usr/share/software-center/softwarecenter/backend/installbackend_impl/aptd.py", line 166, in _register_active_transactions_watch
apt_daemon = client.get_aptdaemon(bus=bus)
File "/usr/lib/python2.7/dist-packages/aptdaemon/client.py", line 1701, in get_aptdaemon
False),
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
2018-10-24 18:12:04,999 - softwarecenter.db.pkginfo_impl.aptcache - INFO - aptcache.open()
/usr/lib/python2.7/dist-packages/gi/overrides/GLib.py:585: Warning: Source ID 67 was not found when attempting to remove it
return super(MainContext, self).iteration(may_block)
/usr/share/software-center/softwarecenter/ui/gtk3/widgets/videoplayer.py:29: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import Gst
2018-10-24 18:12:06,462 - softwarecenter.backend.spawn_helper - WARNING - exit code 1 from helper for '['/usr/share/software-center/piston_generic_helper.py', '--datadir', '/usr/share/software-center/', 'SoftwareCenterAgentAPI', 'exhibits', '{"lang": "en", "series": "xenial"}']'
2018-10-24 18:12:06,463 - softwarecenter.backend.spawn_helper - WARNING - got error from helper: 'WARNING:__main__:no data
'
/usr/bin/software-center:184: Warning: Source ID 148 was not found when attempting to remove it
Gtk.main()
2018-10-24 18:12:09,303 - softwarecenter.backend.spawn_helper - WARNING - exit code 1 from helper for '['/usr/share/software-center/piston_generic_helper.py', '--datadir', '/usr/share/software-center/', 'SoftwareCenterAgentAPI', 'available_apps', '{"lang": "en", "series": "xenial", "arch": "amd64"}']'
2018-10-24 18:12:09,304 - softwarecenter.backend.spawn_helper - WARNING - got error from helper: 'WARNING:__main__:no data
'
2018-10-24 18:12:09,304 - softwarecenter.db.update - WARNING - update_from_software_center_agent: error: 'WARNING:__main__:no data\n'
2018-10-24 18:12:09,335 - softwarecenter.db.utils - INFO - software-center-agent finished with status 1
Traceback (most recent call last):
File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/viewswitcher.py", line 149, in config_view
pane = vm.set_active_view(view_id)
File "/usr/share/software-center/softwarecenter/ui/gtk3/session/viewmanager.py", line 150, in set_active_view
view_widget.init_view()
File "/usr/share/software-center/softwarecenter/ui/gtk3/panes/installedpane.py", line 143, in init_view
self.oneconf_handler = get_oneconf_handler(self.oneconf_viewpickler)
File "/usr/share/software-center/softwarecenter/backend/oneconfhandler/__init__.py", line 32, in get_oneconf_handler
oneconf_handler = OneConfHandler(oneconfviewpickler)
File "/usr/share/software-center/softwarecenter/backend/oneconfhandler/core.py", line 56, in __init__
self.oneconf = DbusConnect()
File "/usr/lib/python2.7/dist-packages/oneconf/dbusconnect.py", line 152, in __init__
HOSTS_OBJECT_NAME)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process com.ubuntu.OneConf exited with status 1