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

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

我似乎无法在单击“软件和更新”应用程序后显示它。我不知道为什么。它的图标出现在快捷方式中。激活此应用程序的终端命令是什么?

我曾尝试过这个答案:“软件更新程序”和“软件和更新”不起作用,但没有效果。

$ uname -a
Linux 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

$ gnome-shell --version
GNOME Shell 3.28.4

$ software-properties-gtk
ERROR:dbus.proxies:Introspect error on :1.228:/: 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 173, 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.228 was not provided by any .service files

我也有同样的信息Ubuntu 18.04 software-properties-gtk 因 org.freedesktop.DBus.Error.ServiceUnknown 而失败。我使用 Synaptic 重新安装了该软件包python3-size,正如本文中提到的那样回答但无济于事。

我也曾尝试过清除并重新安装,software-properties-gtk正如提到的那样这里但无济于事。

更新1:

我想知道setuptools.py版本 50.0 是否破坏了软件属性-gtk 的连接?我知道系统昨天从版本 42.0.2 升级了此版本。我刚刚发现这个 GitHub 问题“setuptools 50 中断 pip 安装“这是 22 小时前提出的。我已经卸载它了,但无济于事。

更新 2:journalctl -e在终端中 使用cmd,我发现了这个错误消息:

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
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Unable to init server: Could not connect: Connection refused
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Unable to init server: Could not connect: Connection refused
Oct 04 08:22:14 Prime dbus-daemon[1303]: [system] Successfully activated service 'com.ubuntu.SoftwareProperties'
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: Traceback (most recent call last):
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/software-properties/software-properties-dbus", line 68, in <module>
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     server = SoftwarePropertiesDBus(bus, datadir=datadir)
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/python3/dist-packages/softwareproperties/dbus/SoftwarePropertiesDBus.py", line 66, in __init__
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     self._livepatch_service = LivepatchService()
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:   File "/usr/lib/python3/dist-packages/softwareproperties/LivepatchService.py", line 93, in __init__
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]:     self._session = requests_unixsocket.Session()
Oct 04 08:22:14 Prime com.ubuntu.SoftwareProperties[1303]: NameError: name 'requests_unixsocket' is not defined

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

$ pip list | grep requests
requests                2.24.0
requests-unixsocket     0.1.5
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
$ pip3 list | grep requests
requests                2.24.0
requests-unixsocket     0.1.5
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.
$ pip3 list --user | grep requests
requests            2.24.0
WARNING: You are using pip version 20.2.2; however, version 20.2.3 is available.
You should consider upgrading via the '/usr/bin/python3 -m pip install --upgrade pip' command.

我尝试过显式导入requests_unixsocket。成功了。见下文。

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

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

$ ls /usr/lib/python3/dist-packages/ | grep request
requests_unixsocket
requests_unixsocket-0.1.5.egg-info

答案1

python3-six我在 Ubuntu 20.04 上遇到了这个问题。我尝试了建议重新安装和的帖子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

我又重新开始做生意了。

答案2

Ubuntu 20.10 上也存在同样的问题...我查看了 dbus 消息:

sudo systemctl status dbus.service

看到这一行:

.../... com.ubuntu.SoftwareProperties[8310]: ModuleNotFoundError: No module named 'chardet'

所以我重新安装了 chardet:

sudo apt install --reinstall python3-chardet

然后又software-properties-gtk回来了。

日志显示:

dbus-daemon[1130]: [system] Successfully activated service 'com.ubuntu.SoftwareProperties'

希望能帮助到你。

相关内容