我尝试在我的计算机上安装 git,但收到如下错误消息?

我尝试在我的计算机上安装 git,但收到如下错误消息?

我尝试了所有可能的方法,请告诉我如何解决这个错误信息,以及如何在我的计算机上安装 git,

(personal)root@ubuntu:/home/shan/workspace/projects# apt-get -f install git-core
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:
 git-core : Depends: git (> 1:1.7.0.2) but it is not going to be installed
 mysql-server-5.5 : Depends: mysql-server-core-5.5 (= 5.5.35-0ubuntu0.12.04.1) but 5.5.35-0ubuntu0.12.04.2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

答案1

首先你需要删除一些使用冲突的依赖项

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get clean

然后使用添加第三方存储库

sudo apt-get install build-essential

sudo apt-get install python-software-properties

sudo add-apt-repository ppa:git-core/ppa

添加此内容时按 Enter

sudo apt-get update

sudo apt-get -y install git git-man git-svn

现在你的 git 可以正常工作了。

相关内容