我无法在系统设置中打开软件和更新配置窗口。我能做的最好的事情就是从终端打开系统设置并单击软件和更新后出现以下输出:
$ sudo unity-control-center
/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py:40: PyGIWarning: Gdk was imported without specifying a version first. Use gi.require_version('Gdk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Gdk, Gtk, Gio, GLib
/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py:40: 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 GObject, Gdk, Gtk, Gio, GLib
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.ubuntu.SoftwareProperties': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 101, in <module>
app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 141, in __init__
proxy = bus.get_object("com.ubuntu.SoftwareProperties", "/")
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program com.ubuntu.SoftwareProperties: Permission denied
执行时出现同样的错误software-properties-gtk
(因为据我所知,它们是同一个)。
软件更新程序也遇到过类似的问题,并且经常崩溃并出现以下错误:
$ sudo 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
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Dbusmenu was imported without specifying a version first. Use gi.require_version('Dbusmenu', '0.4') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
/usr/lib/python3/dist-packages/UpdateManager/UnitySupport.py:29: PyGIWarning: Unity was imported without specifying a version first. Use gi.require_version('Unity', '7.0') before import to ensure that the right version gets loaded.
from gi.repository import Dbusmenu, Unity
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.debian.apt': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/defer/__init__.py", line 487, in _inline_callbacks
result = gen.send(result)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1613, in _run_transaction_helper
daemon = get_aptdaemon(self.bus)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1701, in get_aptdaemon
False),
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.debian.apt: Permission denied
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.debian.apt': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/defer/__init__.py", line 487, in _inline_callbacks
result = gen.send(result)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1613, in _run_transaction_helper
daemon = get_aptdaemon(self.bus)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1701, in get_aptdaemon
False),
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.debian.apt: Permission denied
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.debian.apt': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1584, in on_error
error.raise_exception()
File "/usr/lib/python3/dist-packages/defer/__init__.py", line 130, in raise_exception
raise self.value.with_traceback(self.traceback)
File "/usr/lib/python3/dist-packages/defer/__init__.py", line 487, in _inline_callbacks
result = gen.send(result)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1613, in _run_transaction_helper
daemon = get_aptdaemon(self.bus)
File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1701, in get_aptdaemon
False),
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.debian.apt: Permission denied
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.debian.apt': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/defer/__init__.py", line 483, in _inline_callbacks
result = gen.throw(excep)
File "/usr/lib/python3/dist-packages/UpdateManager/backend/InstallBackendAptdaemon.py", line 65, in update
trans = yield self.client.update_cache(defer=True)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program org.debian.apt: Permission denied
总的来说,看起来 Python 和 GTK 到处都在呕吐,但我不知道如何解决这个问题。
还存在其他各种相关问题,例如无法从软件中心安装软件包,或者在启动时尝试更新时发生各种崩溃。
我已经尝试过了重新安装软件中心没有运气,而且不敢尝试此解决方案正如评论中所说,这是一个坏主意。我在其他地方都找不到答案,所以才来到这里。
编辑:
有趣的是,我遇到了另一个非常相似的错误nvidia-settings
。尝试保存 xorg.conf 设置时,错误输出如下所示。
$ sudo nvidia-settings ** Message: PRIME: No offloading required. Abort
** Message: PRIME: is it supported? no
Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 175, in activate_name_owner
return self.get_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
's', (bus_name,), **keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'com.ubuntu.ScreenResolution.Mechanism': no such name
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/share/screen-resolution-extra/nvidia-polkit.py", line 75, in <module>
operation_status = main(options)
File "/usr/share/screen-resolution-extra/nvidia-polkit.py", line 42, in main
conf = get_xkit_service()
File "/usr/share/screen-resolution-extra/nvidia-polkit.py", line 33, in get_xkit_service
service_object = dbus.SystemBus().get_object(SERVICE_NAME, OBJECT_PATH)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python3/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: Failed to execute program com.ubuntu.ScreenResolution.Mechanism: Permission denied
ERROR: Unable to open X config file '/etc/X11/xorg.conf' for writing.
稍后,当我尝试更新时pip
,我发现此错误:
$ sudo pip install --upgrade pip
The directory '/home/max/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
答案1
我遇到了同样的问题,Ubuntu 16.04,64 位,重新安装了所有支持包:
sudo aptitude reinstall apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core dbus
解决了这个问题。请注意,一个临时的解决方法是sudo aptd
在运行之前在另一个终端中运行update-manager
,然后update-manager
就能够aptd
通过 dbus 连接到。
不幸的是,现在我的问题已经解决,我无法确定哪个软件包是准确的修复,但如果你尝试逐个重新安装,你可以报告。由于安装失败,我的系统中的许多软件包被破坏,导致由于缺少文件、权限和脚本而出现类似这样的奇怪问题;重新安装软件包可以解决这些问题。
答案2
我正要重新安装系统,直到我找到了davidjb的解决方案。
所以,
sudo apt-get install aptitude
其次是
sudo aptitude reinstall dbus
为我解决了这个问题。
答案3
补充一下我的意见:Ubuntu-Mate 16.04,安装于 2017 年 6 月 15 日,所有更新。出现过类似问题(dbus.exceptions.DBusExcept 等),解决方法如下:
sudo aptitude reinstall python-pkg-resources python3-pkg-resources
欢呼吧,瓦伦丁
答案4
我遇到了与问题类似的问题,我无法update-manager
在我的 Xubuntu 16.04 中运行,并且收到类似的错误消息,因为我已将软链接python3
从更改python3.5
为python3.8
。
目前,update-manager
他们的子进程/包正在运行仅有的在python3.5
。
因此我编辑了以下文件的代码并更改了什邦在文件顶部从#!/usr/bin/python3
到#!/usr/bin/python3.5
/usr/sbin/aptd
/usr/bin/add-apt-repository
/usr/bin/update-manager
我可以运行更新管理器,但无需设置。
警告:这不是一个非常干净的编辑/usr/bin
安装文件的方法,但我宁愿做这个快速修复并在我的系统中使用最新版本python3.8
。:)