大约 3 周前,我下载了 Ubuntu 12.04,从那时起我就一直在使用它。起初一切都运行良好,但大约 10 天前,Ubuntu 软件中心停止工作(我以前使用它没有问题)。现在,我可以打开它并找到程序,但当我单击其中一个程序的“安装”按钮时,什么也没有发生。这个问题似乎只存在于软件中心——我仍然可以从命令行使用 apt-get,没有任何问题。
我尝试过删除并重新安装软件中心,也尝试过使用 sudo software-center 从终端运行它(以防权限出现问题)。当我使用终端时,启动软件中心时,终端上会打印一条很长的错误消息(是的,一个看似相同的回溯被打印了两次):
2013-08-25 12:38:50,829 - softwarecenter.ui.gtk3.app - INFO - setting up proxy 'None'
2013-08-25 12:38:50,833 - softwarecenter.db.database - INFO - open() database: path=None use_axi=True use_agent=True
2013-08-25 12:38:51,079 - softwarecenter.backend.reviews - WARNING - Could not get usefulness from server, no username in config file
2013-08-25 12:38:51,178 - softwarecenter.ui.gtk3.app - INFO - show_available_packages: search_text is '', app is None.
2013-08-25 12:38:51,181 - softwarecenter.db.pkginfo_impl.aptcache - INFO - aptcache.open()
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 607, in msg_reply_handler
*message.get_args_list()))
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 69, in error_cb
callback('')
File "/usr/share/software-center/softwarecenter/backend/installbackend_impl/aptd.py", line 153, in _register_active_transactions_watch
apt_daemon = client.get_aptdaemon(bus=bus)
File "/usr/lib/python2.7/dist-packages/aptdaemon/client.py", line 1696, in get_aptdaemon
False),
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 607, in msg_reply_handler
*message.get_args_list()))
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 69, in error_cb
callback('')
File "/usr/share/software-center/softwarecenter/backend/installbackend_impl/aptd.py", line 153, in _register_active_transactions_watch
apt_daemon = client.get_aptdaemon(bus=bus)
File "/usr/lib/python2.7/dist-packages/aptdaemon/client.py", line 1696, in get_aptdaemon
False),
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
File "/usr/lib/python2.7/dist-packages/dbus/proxies.py", line 248, in __init__
self._named_service = conn.activate_name_owner(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 180, in activate_name_owner
self.start_service_by_name(bus_name)
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 278, in start_service_by_name
'su', (bus_name, flags)))
File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 1
2013-08-25 12:38:53,215 - softwarecenter.ui.gtk3.widgets.exhibits - WARNING - download failed: '<class 'gi._glib.GError'>', 'Operation not supported'
有什么建议么?
编辑:经过更多搜索后,我发现了这个错误报告:https://bugs.launchpad.net/ubuntu/+source/software-center/+bug/1085425 它描述的症状与我的类似,我发现当我跑步时
/usr/lib/ubuntu-sso-client/ubuntu-sso-login
正如那里描述的,我收到了一系列错误消息,最后是:
ImportError: No module named pkg_resources
然后我发现了这个 stackoverflow 线程: https://stackoverflow.com/questions/7446187/no-module-named-pkg-resources 我能够使用顶部注释重新安装 setuptools,这解决了我的问题。
答案1
尝试这些:
打开终端(CTRL++ ALT)T并执行以下命令:
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt-get --purge remove
sudo apt-get -f install
上述命令将尝试修复损坏的软件包(如果有),并且如果意外错过,还将安装所需的库文件。
如果仍然不起作用,那么您唯一能做的就是使用其他软件包管理器,最好的是 Synaptic 软件包管理器。您可以使用它非常轻松地添加/删除/更新/修复损坏的软件包。正如您所说,Ubuntu 软件中心无法安装软件包,然后浏览其中的软件包并使用 Synaptic 软件包管理器安装它们。
使用以下命令安装:
sudo apt-get install synaptic
我希望你会喜欢这个包管理器。
答案2
在终端中,运行以下命令。
sudo apt-get check
sudo apt-get update
sudo apt-get upgrade
rm -r ~/.cache/software-center
sudo dpkg --configure -a
sudo apt-get clean
答案3
我认为你的服务器有问题
尝试选择其他
Synaptic Package Manager
在 Dash 中搜索- 选择设置 > 存储库 > Ubuntu 软件
- 选择下面的新服务器下载自
有关更多详细信息,请参阅 Ubuntu 帮助 wiki 中的此页面:存储库帮助。