从源代码安装git后出现问题

从源代码安装git后出现问题

我有以下问题。

我已经从源代码安装了最新的 git 版本,但也许我做错了什么,因为现在当我尝试使用安装/卸载任何东西时,apt-get我收到以下消息:

You might want to run `apt-get -f install' to correct these:

The following packages have unmet dependencies:

git-core: Depends: git (> 1:1.7.0.2) but it is not going to be installed

E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

好了,之后sudo apt-get -f install它建议安装 git:

The following extra packages will be installed:
git

输入“Y”后我收到另一个错误:

dpkg: error processing /var/cache/apt/archives/git_2%3a2.3.6-1avh1~lucid1_amd64.deb (--unpack):

trying to overwrite '/etc/bash_completion.d/git', which is also in package git-core 2:2.3.6-1avh1~lucid1

Errors were encountered while processing:
 /var/cache/apt/archives/git_2%3a2.3.6-1avh1~lucid1_amd64.deb

E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何修复它?

答案1

尝试 apt-get purge git

然后,您无需从源代码进行编译,而是可以添加另一个具有最新可用 git 的 repo,这将在此处解释,允许您在添加新的 repo 后简单地使用 apt-get install git

如何使用 apt 安装最新版本的 Git?

相关内容