
大家好,我對 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
出現此錯誤的原因是,由於安裝了 apt-get 依賴關係樹,因此已達到不穩定狀態mariadb 用戶端軟體包的版本比預期的要新/舊mariadb 伺服器。
嘗試卸載 mariadb-client
$ sudo apt-get purge mariadb-client-5.5
然後嘗試透過以下方式糾正您的依賴關係樹
$ sudo apt-get -f install
然後嘗試安裝git。