我遇到一个问题,software-properties-gtk
当我尝试打开它时会出现错误:
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 245, in __init__
self.init_distro()
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 424, in init_distro
distro = current_distro()
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/utils.py", line 72, in current_distro
releases = di.get_all(result="object")
AttributeError: 'UbuntuDistroInfo' object has no attribute 'get_all'
出于某种原因,当我运行 时sudo software-properties-gtk
,它运行完美。但是,当我尝试打开桌面应用程序或不使用 sudo 运行它时,它会给我上述错误。
我已经尝试过了sudo apt-get install --reinstall python3-minimal
,虽然这里有很多关于 software-properties-gtk 的问题,但似乎没有一个与这个问题相关。
答案1
经过进一步挖掘,我偶然发现了这篇 reddit 帖子: https://www.reddit.com/r/linux4noobs/comments/qyxq6t/softwarepropertiesgtk_wont_execute_due_to_python/
他们的解决方案是运行
python3 -m pip uninstall distro-info
sudo apt reinstall python3-distro-info
有效!