软件和更新以及软件更新程序在 Ubuntu 20.04 中无法打开

软件和更新以及软件更新程序在 Ubuntu 20.04 中无法打开

我不知道我的系统到底出了什么问题;我怀疑这与我的 Python 升级有关,但我不确定。

有些部分我已经修复了,但是当我单击图标时,甚至当我尝试从终端启动它时,Software & Updates它仍然无法打开。Software Updater

的输出sudo update-alternatives --config python3为:

There are 3 choices for the alternative python3 (providing /usr/bin/python3).

  Selection    Path                 Priority   Status
------------------------------------------------------------
  0            /usr/bin/python3.9    2         auto mode
  1            /usr/bin/python3.10   1         manual mode
  2            /usr/bin/python3.8    2         manual mode
* 3            /usr/bin/python3.9    2         manual mode

Press <enter> to keep the current choice[*], or type selection number: 

我已经监控了sudo journalctl -f输出:

fev 15 16:17:55 aorus-15g systemd[3039]: Started Application launched by gnome-shell.
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]: Traceback (most recent call last):
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:   File "/usr/bin/software-properties-gtk", line 37, in <module>
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:     from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:   File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 32, in <module>
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:     import dbus
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:   File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 73, in <module>
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:     import dbus.types as types
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:   File "/usr/lib/python3/dist-packages/dbus/types.py", line 8, in <module>
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]:     from _dbus_bindings import (
fev 15 16:17:55 aorus-15g software-properties-gtk.desktop[95441]: ModuleNotFoundError: No module named '_dbus_bindings'
fev 15 16:17:55 aorus-15g systemd[3039]: gnome-launched-software-properties-gtk.desktop-95441.scope: Succeeded.
fev 15 16:17:58 aorus-15g systemd[3039]: Started Application launched by gnome-shell.
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]: Traceback (most recent call last):
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]:   File "/usr/bin/update-manager", line 28, in <module>
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]:     import gi
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]:   File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]:     from . import _gi
fev 15 16:17:58 aorus-15g update-manager.desktop[95444]: ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)
fev 15 16:17:58 aorus-15g systemd[3039]: gnome-launched-update-manager.desktop-95444.scope: Succeeded.

任何关于如何解决此问题的帮助或参考都将非常有用,我们将不胜感激。问候,莱昂纳多

答案1

经过几天的测试和阅读,我确实明白了哪里出了问题;

在我更新我的 Python 版本后,update-alternatives它开始显示一些错误并且无法打开一些操作系统应用程序;

由于默认的 Python 是 3.8,我将其改回sudo update-alternatives --config python3软件更新程序的选项 2,软件更新开始按预期工作。

相关内容