sudo apt-get install git 问题

sudo apt-get install git 问题

嗨,我对 Ubuntu 还不太熟悉。不过,我通常可以在全新安装的 ubunty 14.10 上运行它

sudo apt-get update
sudo apt-get install git

然后 git 就安装好了

但我得到的是

me@server1:~$ sudo apt-get install git
[sudo] password for me: 
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 : Depends: liberror-perl but it is not going to be installed
       Depends: git-man (> 1:2.4.5) but it is not going to be installed
       Depends: git-man (< 1:2.4.5-.) but it is not going to be installed
 mariadb-client-5.5 : Breaks: mariadb-server-5.5 (< 5.5.44-1ubuntu0.14.10.1) but 5.5.39-2 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
me@server1:~$ git
The program 'git' is currently not installed. You can install it by typing:
sudo apt-get install git
me@server1:~$ 

它似乎apt-get不会自动安装依赖项,git命令只是返回git is currently not installed。运行sudo apt-get -f install不会改变任何东西

我在这里做错了什么?(注意:我不想安装 mariadb)

编辑:运行后sudo apt-get purge mariadb-client-5.5

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:
 mariadb-client : Depends: mariadb-client-5.5 (>= 5.5.39-2) but it is not going to be installed
 mariadb-server-5.5 : Depends: mariadb-client-5.5 (>= 5.5.39-2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

答案1

出现此错误的原因是,由于安装了mariadb 客户端比预期版本更新/更旧的软件包mariadb 服务器

尝试卸载 mariadb-client

$ sudo apt-get purge mariadb-client-5.5

然后尝试通过以下方式纠正依赖关系树

 $ sudo apt-get -f install

然后尝试安装 git。

相关内容