软件属性-gtk 无法打开

软件属性-gtk 无法打开

我关注了有关此商品的所有问题,但没有一个能给我解决方案。有人能帮助我吗?

Ubuntu 19.04 的 software-properties-gtk 输出:

wim@PC-kamer:~$ software-properties-gtk
ERROR:dbus.proxies:Introspect error on :1.209:/: 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)
and tried 
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.209 was not provided by any .service files

答案1

这是由于缺少或损坏的 Python 包造成的。

首先,检查缺少哪些包,运行: sudo journalctl -u dbus -f JournalCTL 是用于访问 Systemd 日志的日志记录程序,-u是您要查看日志的单元,-f意思是“关注”,它将保持打开并打印新日志,直到您关闭它。

打开一个新终端并尝试运行software-properties-gtk,您的第一个终端将收到 Python 错误,告诉您缺少哪些包:

Sep 18 00:33:42 Tiles-PC dbus-daemon[3736]: [system] Activating service name='com.ubuntu.SoftwareProperties' requested by ':1.1926' (uid=1000 pid=408791 comm="/usr/bin/python3 /usr/bin/software-properties-gtk " label="unconfined") (using servicehelper)
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Unable to init server: Could not connect: Connection refused
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Unable to init server: Could not connect: Connection refused
Sep 18 00:33:42 Tiles-PC dbus-daemon[3736]: [system] Successfully activated service 'com.ubuntu.SoftwareProperties'
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Traceback (most recent call last):
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     server = SoftwarePropertiesDBus(bus, datadir=datadir)
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     self._livepatch_service = LivepatchService()
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     self._session = requests_unixsocket.Session()
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: NameError: name 'requests_unixsocket' is not defined
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Error in sys.excepthook:
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Traceback (most recent call last):
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/apport_python_hook.py", line 72, in apport_excepthook
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     from apport.fileutils import likely_packaged, get_recent_crashes
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     from apport.report import Report
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/apport/report.py", line 32, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     import apport.fileutils
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/apport/fileutils.py", line 12, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     import os, glob, subprocess, os.path, time, pwd, sys, requests_unixsocket
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/requests_unixsocket/__init__.py", line 1, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     import requests
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: ModuleNotFoundError: No module named 'requests'
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Original exception was:
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: Traceback (most recent call last):
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     server = SoftwarePropertiesDBus(bus, datadir=datadir)
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     self._livepatch_service = LivepatchService()
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:   File "/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]:     self._session = requests_unixsocket.Session()
Sep 18 00:33:42 Tiles-PC com.ubuntu.SoftwareProperties[408804]: NameError: name 'requests_unixsocket' is not defined

您正在寻找的ModuleNotFoundError,就我的情况而言requestsrequests_unixsocket已丢失或损坏。

重新安装丢失或损坏的软件包: sudo apt install python3-requests python3-requests-unixsocket --reinstall

尝试software-properties-gtk再次运行。如果还有其他包损坏,您可能需要多次重复该过程。

答案2

在 wim@PC-kamer:~$ software-properties-gtk 输出的底部有错误:dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: 任何 .service 文件均未提供名称:1.209

重新安装是否安全:dBus dBus-user-session dbus-x11 python-dbus python3-dBus python3-dBus.mainloop.qt ubuntu-system-service

任何人?

相关内容