0

I have missed up with my python3 version in Ubuntu 20.04, and after calling $ update-manager I'm getting the following Error, can you please tell me how can I fix that

P.S: I have tried some solutions, but they didn't work in my case.

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
4
  • 1
    You need to restore the default python.
    – Pilot6
    Feb 27, 2023 at 11:34
  • @Pilot6 I did already, but this is the aftermath.
    – Bilal
    Feb 27, 2023 at 11:39
  • See if sudo apt install --reinstall python3 solves it?
    – Raffa
    Feb 27, 2023 at 12:37
  • @Raffa I have already done that, but still the error the same.
    – Bilal
    Feb 27, 2023 at 13:00

1 Answer 1

0

It's been long time, but here's my solution.

  1. Run sudo systemctl status dbus.
  2. You can see some errors there. We need to solve them in order to activate service 'com.ubuntu.SoftwareProperties' or any other service.

Eg: In my case

  1. No dbus_bindings.

Solution: Go to /usr/lib/python3/dist-packages/ and create link to your _dbus_bindings and _dbus_glib_bindings.

sudo ln -s _dbus_glib_bindings.cpython-***.so _dbus_glib_bindings.so and so on.

  1. No _gi module: follow this https://stackoverflow.com/a/60352723

Finally you can check dbus status again, and it should be like this: Successfully activated service '***'

In your case: enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .