我无法从 ubuntu 16.04 系统的 GUI 或终端打开“软件和更新”
sudo software-properties-gtk
sudo: unable to resolve host dna-ws: Connection timed out
[sudo] password for localadmin:
Traceback (most recent call last):
File "/usr/bin/software-properties-gtk", line 37, in <module>
from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 29, in <module>
import dbus
File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 82, in <module>
import dbus.types as types
File "/usr/lib/python3/dist-packages/dbus/types.py", line 6, in <module>
from _dbus_bindings import (
ModuleNotFoundError: No module named '_dbus_bindings'
我也无法使用 GUI 安装软件
我试过;
sudo apt-get install python-dbus
sudo: unable to resolve host dna-ws: Connection timed out
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-dbus is already the newest version (1.2.0-3).
python-dbus set to manually installed.
0 to upgrade, 0 to newly install, 0 to remove and 187 not to upgrade.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ssmtp (2.64-8ubuntu1) ...
hostname: Temporary failure in name resolution
dpkg: error processing package ssmtp (--configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不知道该怎么做才能解决这个问题,而且我不想对系统造成任何损害。
答案1
我的情况是,从 3.6(ubuntu 18.04)升级到 3.7 时出现此错误消息:
$ pwd
/usr/lib/python3/dist-packages
$ sudo cp _dbus_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_bindings.cpython-37m-x86_64-linux-gnu.so
$ sudo cp _dbus_glib_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_glib_bindings.cpython-37m-x86_64-linux-gnu.so
答案2
另一个解决方案是创建符号链接。只需获取前面的第一个字符串.cpython
并将其附加.so
到它即可。
sudo ln -s _dbus_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_bindings.so
sudo ln -s _dbus_glib_bindings.cpython-36m-x86_64-linux-gnu.so _dbus_glib_bindings.so
答案3
似乎软件包ssmtp
未完全安装。您可以尝试使用 重新安装它,sudo apt install --reinstall ssmtp
或者如果您的计算机上没有运行本地邮件服务,您可以使用 将其删除sudo apt remove ssmtp
。