我想安装 git,sudo apt-get install git
在我的 ubuntu 14.04 上安装 git 后。日志在这里:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package git is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
git-man
E: Package 'git' has no installation candidate
然后,这问题是,我运行 git-core 而不是 git,但也失败了。顺便说一句,我也尝试过apt-get update
。
此后,我尝试了这问题,前面两个命令没有问题,但是输入最后一条命令之后,还是报错,Log如下:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
aptitude:i386 : Depends: libapt-pkg4.12:i386 (>= 0.8.16~exp12ubuntu6) but it is not installable
Depends: libboost-iostreams1.46.1:i386 (>= 1.46.1-1) but it is not installable
Depends: libc6:i386 (>= 2.4) but it is not installable
Depends: libcwidget3:i386 but it is not installable
Depends: libept1.4.12:i386 but it is not installable
Depends: libgcc1:i386 (>= 1:4.1.1) but it is not installable
Depends: libncursesw5:i386 (>= 5.6+20070908) but it is not installable
Depends: libsigc++-2.0-0c2a:i386 (>= 2.0.2) but it is not installable
Depends: libsqlite3-0:i386 (>= 3.6.5) but it is not installable
Depends: libstdc++6:i386 (>= 4.6) but it is not installable
Depends: libtinfo5:i386 but it is not installable
Depends: libxapian22:i386 but it is not installable
Recommends: apt-xapian-index:i386 but it is not installable
Recommends: libparse-debianchangelog-perl:i386 but it is not installable
git : Depends: git-man (> 1:2.7.1) but 1:1.9.1-1ubuntu0.2 is to be installed
ppa-purge : Depends: aptitude but it is not installable
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我最终不知道该怎么办了...有人可以告诉我任何想法吗?
答案1
刚刚遇到这个问题。当我启动软件和更新时,我只检查了:[x] 社区维护的免费和开源软件(universe),但没有检查 [ ] Canonical 支持的免费和开源软件(main)
检查(主要)允许我安装 git 和其他我遇到问题的软件包(例如 pylint)。
答案2
我最终找到解决方案,首先打开 Ubuntu 系统的软件和更新。选择“Canonical 支持的免费...”,那么选择其他软件页面中的所有选项。
然后运行sudo apt-get install -f
来修复那些缺失的依赖项。
然后运行sudo apt-get update && apt-get upgrade
,我的 apt-get 就可以再次使用了。
希望当您遇到与我类似的问题时这可以提供帮助。
答案3
我找到了解决办法,首先打开Ubuntu系统的Software & Updates,选择“Canonical支持的免费...”,然后在Other Software页面中选择所有选项。
然后运行
sudo apt-get install -f
修复那些缺失的依赖项。
然后运行
sudo apt-get update
sudo apt-get upgrade
我的 apt-get 又能用了。