org.freedesktop.DBus.Error.NameHasNoOwner:无法获取名称“org.debian.apt”的所有者:没有此名称

org.freedesktop.DBus.Error.NameHasNoOwner:无法获取名称“org.debian.apt”的所有者:没有此名称

我在 Ubuntu 中错过了我的 python3 版本20.04,调用后$ update-manager我收到以下错误,你能告诉我如何修复它吗

附言:我已经尝试了一些解决方案,但它们对我的情况不起作用。

Traceback (most recent call last):
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 173, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 348, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
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 "/home/belal/.local/lib/python3.8/site-packages/defer/__init__.py", line 479, in _inline_callbacks
    result = gen.send(result)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1623, in _run_transaction_helper
    daemon = get_aptdaemon(self.bus)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1709, in get_aptdaemon
    return dbus.Interface(bus.get_object("org.debian.apt",
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 237, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 178, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 273, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
Traceback (most recent call last):
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 173, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 348, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
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 "/home/belal/.local/lib/python3.8/site-packages/defer/__init__.py", line 479, in _inline_callbacks
    result = gen.send(result)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1623, in _run_transaction_helper
    daemon = get_aptdaemon(self.bus)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1709, in get_aptdaemon
    return dbus.Interface(bus.get_object("org.debian.apt",
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 237, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 178, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 273, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1594, in on_error
    error.raise_exception()
  File "/home/belal/.local/lib/python3.8/site-packages/defer/__init__.py", line 125, in raise_exception
    raise self.type(self.value).with_traceback(self.traceback)
  File "/home/belal/.local/lib/python3.8/site-packages/defer/__init__.py", line 479, in _inline_callbacks
    result = gen.send(result)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1623, in _run_transaction_helper
    daemon = get_aptdaemon(self.bus)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1709, in get_aptdaemon
    return dbus.Interface(bus.get_object("org.debian.apt",
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 237, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 178, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/bus.py", line 273, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/connection.py", line 634, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/belal/.local/lib/python3.8/site-packages/defer/__init__.py", line 390, in _next
    self.result = callback(self.result, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/aptdaemon/client.py", line 1596, in on_error
    error_handler(error)
  File "/usr/lib/python3/dist-packages/aptdaemon/errors.py", line 196, in <lambda>
    get_native_exception(err))
  File "/usr/lib/python3/dist-packages/aptdaemon/errors.py", line 211, in get_native_exception
    dbus_msg = error.get_dbus_message()
  File "/home/belal/.local/lib/python3.8/site-packages/dbus/exceptions.py", line 82, in get_dbus_message
    s = ''.join(self.args)
TypeError: sequence item 0: expected str instance, DBusException found

答案1

已经过去很长时间了,但这是我的解决方案。

  1. 跑步sudo systemctl status dbus
  2. 您可以在此处看到一些错误。我们需要解决它们才能激活服务“com.ubuntu.SoftwareProperties”或任何其他服务。

例如:就我而言

  1. 没有 dbus_bindings。

解决方案:转到/usr/lib/python3/dist-packages/并创建到您的_dbus_bindings和 的链接_dbus_glib_bindings

sudo ln -s _dbus_glib_bindings.cpython-***.so _dbus_glib_bindings.so等等。

  1. 没有 _gi 模块:按照此https://stackoverflow.com/a/60352723

最后你可以再次检查 dbus 状态,它应该是这样的:Successfully activated service '***'

就你的情况而言: 在此处输入图片描述

相关内容