我的 Ubuntu 软件中心无法启动。我已阅读了几个相关问题,并尝试了 Ask Ubuntu 的各种建议,包括这个问题,但所有尝试都返回相同的错误消息。我正在运行 Ubuntu 12.04。
sudo apt-get install --reinstall software-center
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install --reinstall python-pkg-resources
所有尝试均会出现以下错误:
Errors were encountered while processing:
/var/cache/apt/archives/python-problem-report_2.0.1-0ubuntu15.1_all.deb
/var/cache/apt/archives/python-apport_2.0.1-0ubuntu15.1_all.deb
/var/cache/apt/archives/apport_2.0.1-0ubuntu15.1_all.deb
/var/cache/apt/archives/python-aptdaemon.gtk3widgets_0.43+bzr805-0ubuntu7_all.deb
/var/cache/apt/archives/python-aptdaemon.pkcompat_0.43+bzr805-0ubuntu7_all.deb
/var/cache/apt/archives/python-aptdaemon_0.43+bzr805-0ubuntu7_all.deb
/var/cache/apt/archives/software-center_5.2.6_all.deb
我该如何纠正这些错误并使我的系统正常运行?
回应 Lucio 的评论:
运行以下两行代码产生相同的错误。
sudo apt-get clean
sudo apt-get update && sudo apt-get upgrade
继续查看帮助文件,我运行:
sudo dpkg --configure -a
并收到以下错误:
Errors were encountered while processing:
python-pkg-resources
python-aptdaemon
python-aptdaemon.pkcompat
apport-gtk
software-center
python-aptdaemon.gtk3widgets
gedit-plugins
python-problem-report
aptdaemon
update-notifier-common
python-apport
flashplugin-installer
apport
最后,我运行:
sudo apt-get -f install
但这又犯了原始错误。
我正在安装 Python 3.3 作为默认设置,而不是 Python2.7。这些(来自/usr/bin
)是否造成了我的问题?
*-rwxr-xr-x 1 root root 4124 Apr 17 2012 pyclean
*-rwxr-xr-x 1 root root 11933 Apr 17 2012 pycompile
*lrwxrwxrwx 1 root root 8 Aug 14 18:02 pydoc -> pydoc2.7
*-rwxr-xr-x 1 root root 79 Aug 1 01:40 pydoc2.7
*lrwxrwxrwx 1 root root 12 Aug 14 18:02 pygettext -> pygettext2.7
*-rwxr-xr-x 1 root root 22103 Aug 1 01:40 pygettext2.7
*-rwxr-xr-x 1 root root 217 Mar 9 2012 pyhtmlizer
*lrwxrwxrwx 1 root root 28 Dec 24 01:51 python -> /usr/bin/Python-3.3.0/python
*lrwxrwxrwx 1 root root 9 Aug 14 18:02 python2 -> python2.7
*-rwxr-xr-x 1 root root 2989480 Aug 1 01:40 python2.7
*drwxr-xr-x 16 inigomontoya inigomontoya 4096 Dec 24 01:42 Python-3.3.0
*-rw-r--r-- 1 root root 16327785 Sep 29 05:15 Python-3.3.0.tgz
*lrwxrwxrwx 1 root root 29 Aug 14 18:02 pyversions -> ../share/python/pyversions.py
答案1
如果问题出在 python 版本上,您能否发布输出sudo update-alternatives --config python
?如果它显示默认为 python 3.3,请将其更改为 python 2.7,然后重新安装软件中心,否则 python 版本似乎不是根本原因。