问题:
tim@ubuntu:~$ software-properties-gtk
ERROR:dbus.proxies:Introspect error on :1.103:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 100, in <module>
app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 172, in __init__
self.backend.Reload();
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.103 was not provided by any .service files
tim@ubuntu:~$
每次我尝试时,“名称”值都会增加。
我尝试过清除并重新安装dbus
例如
sudo aptitude reinstall apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core dbus
但无济于事。
这是 Xubuntu 18.04 安装,到目前为止没有出现任何问题。
更多信息:
journalctl -e
输出结果如下:
06 17:41:56 ubuntu earlyoom[810]: mem avail: 6439 of 7950 MiB (80 %), swap free: 3975 of 3975 MiB (100 %)
Sep 06 17:41:57 ubuntu dbus-daemon[723]: [system] Activating service name='com.ubuntu.SoftwareProperties' requested by ':1.97' (uid=1000 pid=5778 comm="/usr/bin/python3 /usr/bi
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: Unable to init server: Could not connect: Connection refused
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: Unable to init server: Could not connect: Connection refused
Sep 06 17:41:57 ubuntu dbus-daemon[723]: [system] Successfully activated service 'com.ubuntu.SoftwareProperties'
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: Traceback (most recent call last):
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: server = SoftwarePropertiesDBus(bus, datadir=datadir)
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: self._livepatch_service = LivepatchService()
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: File "/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: self._session = requests_unixsocket.Session()
Sep 06 17:41:57 ubuntu com.ubuntu.SoftwareProperties[723]: NameError: name 'requests_unixsocket' is not defined
答案1
事实证明,/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py 中的 import request_unixsocket 失败,因为
try:
import dateutil.parser
import requests_unixsocket
gi.require_version('Snapd', '1')
from gi.repository import Snapd
except(ImportError, ValueError):
pass
并且 dateutil.parser 未导入,错误为模块 six 不存在。软件包 python3-six 已安装(我的软件包管理器显示如此)。当我重新安装此软件包时,software-properties-gtk 再次正常工作。
答案2
我也遇到了同样的问题。这个方法奏效了:
sudo apt-get update && sudo apt-get install --reinstall python3-six python3-certifi
答案3
对我来说,通过重新安装就可以了python3-urllib3
:
sudo apt install --reinstall python3-urllib3
另外我建议更新python3-six
,python3-certifi
和python3-requests
。
答案4
sudo apt purge software-properties-gtk
sudo apt autoremove
sudo apt update
sudo apt install software-properties-gtk
sudo software-properties-gtk
我遇到了同样的问题,我重新安装了软件属性-gtk,问题解决了