python2.7:未找到:无法安装或删除任何软件包

python2.7:未找到:无法安装或删除任何软件包

我目前无法安装任何软件包。一开始它抱怨找不到/usr/bin/python(这里不确定路径),所以我尝试使用 synaptic 重新安装 python。重新安装也失败了。

现在,我无法访问 Unity 中的侧边栏,键盘快捷键也不起作用。我可以通过右键单击文件并选择“打开方式...”来访问 Chrome,并使用Alt- Ctrl-访问命令行f#,但仅此而已。

我做的sudo apt-get install结果是:

Reading package lists...
Building dependency tree...
Reading state information...
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 apturl : Depends: gconf2 (>= 2.28.1-2)
 gwibber : Depends: libgwibber-gtk2 (>= 3.1.4.1+r1119) but it is not installed
    Depends: libgwibber2 (>= 3.1.4.1) but it is not installed
 ibus : Depends: gconf2 (>= 2.28.1-2)
 libgksu2-0 : Depends: gconf2 (>= 2.28.1-2)
 update-manager : Depends: gksu but it is not installed

sudo apt-get -f install结果如下:

Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libgtkspell0 liblaunchpad-integration1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  gconf2 gksu gwibber gwibber-service language-selector-common
  language-selector-gnome libgwibber-gtk2 libgwibber2
Suggested packages:
  gconf-defaults-service gwibber-service-flickr gwibber-service-digg
  gwibber-service-statusnet gwibber-service-foursquare
  gwibber-service-friendfeed gwibber-service-pingfm gwibber-service-qaiku
  unity-lens-gwibber
Recommended packages:
  gwibber-service-facebook gwibber-service-twitter gwibber-service-identica
The following NEW packages will be installed:
  gconf2 gksu libgwibber-gtk2 libgwibber2
The following packages will be upgraded:
  gwibber gwibber-service language-selector-common language-selector-gnome
4 upgraded, 4 newly installed, 0 to remove and 5 not upgraded.
15 not fully installed or removed.
Need to get 0 B/866 kB of archives.
After this operation, 1,281 kB of additional disk space will be used.
Do you want to continue [Y/n]? Setting up python-minimal (2.7.3-0ubuntu2) ...
/var/lib/dpkg/info/python-minimal.postinst: 4: /var/lib/dpkg/info/python-minimal.postinst: python2.7: not found
dpkg: error processing python-minimal (--configure):
 subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
 python-minimal

任何帮助都很好。看来我彻底完蛋了。

我检查了我的/usr/bin directory

lrwxrwxrwx 1 nolando nolando 9 Apr 17  2012 python -> python2.7  
lrwxrwxrwx 1 nolando nolando 9 Apr 17  2012 python2 -> python2.7

我正在使用 12.04。

答案1

哦,解压 python .deb 时出了严重错误。尝试dpkg -i /var/cache/apt/archives/python2.7-minimal*deb看看是否能修复 dpkg 错误。

答案2

这里有类似的问题http://ubuntuforums.org/showthread.php?t=1721421由于 python 具有广泛的依赖性,因此通过重新安装解决了这个问题。

但请尝试使用此论坛的解决方案http://ubuntuforums.org/showthread.php?t=1425619,它可能只是关于 python 配置和版本

尝试一下/usr/bin/python,如果结果很奇怪,请给我们留言或尝试手动查找 python。也许符号链接就足够了。

相关内容