You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04因Python3版本混乱导致update-manager启动失败的修复求助

Ubuntu 20.04因Python3版本混乱导致update-manager启动失败的修复求助

我在Ubuntu 20.04上搞乱了Python3的版本,现在运行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

已尝试但无效的操作

  • 试过一些通用的Python版本重置、update-manager修复方案,但都没能解决这个问题。

求推荐可行的修复步骤

备注:内容来源于stack exchange,提问作者Bilal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 12:47:57