应用程序“软件和更新”没有响应

Sun*_*ear 4 software-sources 18.04

我似乎无法在单击 \xe2\x80\x9cSoftware & Updates\xe2\x80\x9d 应用程序后显示它。我不知道为什么。它的图标出现在快捷方式中。激活此应用程序的终端命令是什么?

\n

我尝试过这个答案:\xe2\x80\x9cSoftware Updater\xe2\x80\x9d & \xe2\x80\x9cSoftware & Updates\xe2\x80\x9d not working,但它不起作用。

\n
$ uname -a\nLinux Ubuntu 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux\n\n$ gnome-shell --version\nGNOME Shell 3.28.4\n\n$ software-properties-gtk\nERROR:dbus.proxies:Introspect error on :1.228:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying\nTraceback (most recent call last):\n  File "/usr/bin/software-properties-gtk", line 100, in <module>\n    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)\n  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 173, in __init__\n    self.backend.Reload();\n  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__\n    return self._proxy_method(*args, **keywords)\n  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__\n    **keywords)\n  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking\n    message, timeout)\ndbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.228 was not provided by any .service files\n
Run Code Online (Sandbox Code Playgroud)\n

我也有与Ubuntu 18.04 software-properties-gtk 相同的消息,失败时出现 org.freedesktop.DBus.Error.ServiceUnknown我按照此答案python3-size中提到的方式使用 Synaptic 重新安装软件包,但没有效果。

\n

我也尝试过software-properties-gtk按照此处提到的方式清除并重新安装,但无济于事。

\n

更新1:

\n

我想知道setuptools.py50.0 版本是否破坏了 software-properties-gtk\ 的连接?我知道系统昨天从版本 42.0.2 进行了升级。我刚刚发现22 小时前提出的GitHub 问题“ setuptools 50 破坏 pip 安装”。我已经卸载了但没有用。

\n

更新 2: \njournalctl -e在终端中使用 cmd,我发现此错误消息:

\n
Oct 04 08:22:14 Prime dbus-daemon[1303]: [system] Activating service name=\'com.ubuntu.SoftwareProperties\' requested by \':1.157\' (uid=1000 pid=10808 comm="/usr/bin/python3 /usr/bin/soft\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Unable to init server: Could not connect: Connection refused\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Unable to init server: Could not connect: Connection refused\nOct 04 08:22:14 Prime dbus-daemon[1303]: [system] Successfully activated service \'com.ubuntu.SoftwareProperties\'\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Traceback (most recent call last):\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     server = SoftwarePropertiesDBus(bus, datadir=datadir)\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     self._livepatch_service = LivepatchService()\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     self._session = requests_unixsocket.Session()\nOct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: NameError: name \'requests_unixsocket\' is not defined\n
Run Code Online (Sandbox Code Playgroud)\n

此外,系统中还安装了 python 包“requests_unixsocket”(见下文)。因此我不明白错误消息NameError: name \'requests_unixsocket\' is not defined

\n
$ pip list | grep requests\nrequests                2.24.0\nrequests-unixsocket     0.1.5\nWARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.\nYou should consider upgrading via the \'/usr/bin/python3 -m pip install --upgrade pip\' command.\n$ pip3 list | grep requests\nrequests                2.24.0\nrequests-unixsocket     0.1.5\nWARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.\nYou should consider upgrading via the \'/usr/bin/python3 -m pip install --upgrade pip\' command.\n$ pip3 list --user | grep requests\nrequests            2.24.0\nWARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.\nYou should consider upgrading via the \'/usr/bin/python3 -m pip install --upgrade pip\' command.\n
Run Code Online (Sandbox Code Playgroud)\n

我尝试显式导入 requests_unixsocket 。有用。见下文。

\n
Python 3.6.9 (default, Jul 17 2020, 12:50:27) \n[GCC 8.4.0] on linux\nType "help", "copyright", "credits" or "license()" for more information.\n>>> import requests_unixsocket\n>>> a = requests_unixsocket.Session()\n>>> a\n<requests_unixsocket.Session object at 0x7fb103952470>\n
Run Code Online (Sandbox Code Playgroud)\n

我不明白为什么我可以导入包但/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py看不到它。它确实存在:

\n
$ ls /usr/lib/python3/dist-packages/ | grep request\nrequests_unixsocket\nrequests_unixsocket-0.1.5.egg-info\n
Run Code Online (Sandbox Code Playgroud)\n

小智 6

我使用的是 Ubuntu 20.04,我遇到了这个问题。python3-six我尝试了建议重新安装的帖子python3-certifi,但这些对我不起作用。然而,在我重新安装software-properties-gtk后,确实又开始为我工作了。因此,总结一下我运行的命令:python3-requestspython3-idna

sudo apt install --reinstall python3-six python3-certifi python3-requests python3-idna
sudo apt install --reinstall software-properties-gtk
software-properties-gtk
Run Code Online (Sandbox Code Playgroud)

我又开始做生意了。