Ubuntu 18.04 software-properties-gtk 因 org.freedesktop.DBus.Error.ServiceUnknown 而失败

Tim*_*son 5 xubuntu 18.04

问题:

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:~$ 
Run Code Online (Sandbox Code Playgroud)

每次尝试时,“名称”值都会增加。

我试过清除并重新安装,dbus 例如

 sudo aptitude reinstall apt apt-utils aptdaemon aptdaemon-data update-manager update-manager-core dbus
Run Code Online (Sandbox Code Playgroud)

但无济于事。

这是一个 Xubuntu 18.04 安装,到目前为止没有出现任何问题。

更多信息:

journalctl -e
Run Code Online (Sandbox Code Playgroud)

给出以下输出:

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
Run Code Online (Sandbox Code Playgroud)

Tim*_*son 3

事实证明, import requests_unixsocket 在 /usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py 中失败,因为

 try:
     import dateutil.parser
     import requests_unixsocket

     gi.require_version('Snapd', '1')
     from gi.repository import Snapd
 except(ImportError, ValueError):
     pass
Run Code Online (Sandbox Code Playgroud)

并且 dateutil.parser 未导入,并出现模块六不存在的错误。软件包 python3-6 已安装(我的软件包管理器是这么说的)。当我重新安装这个软件包时,software-properties-gtk 再次工作。


小智 -1

sudo apt purge software-properties-gtk
sudo apt autoremove
sudo apt update
sudo apt install software-properties-gtk
sudo software-properties-gtk
Run Code Online (Sandbox Code Playgroud)

我遇到了同样的问题,我重新安装了 software-properties-gtk 并且我的问题得到了解决

  • 不幸的是,这个答案也没有解决我的问题。 (2认同)
  • 和这个帖子一样。您可以在[此处](https://askubuntu.com/questions/1271611/app-software-updates-not-responding)查看它。 (2认同)