
我正在嘗試在 Ubuntu 14.04 (Trusty Tahr) 上安裝 Git...當我輸入時
sudo apt-get install git-all
它說:
E: Unable to locate package git
所以我跑了:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E1DD270288B4E6030699E45FA1715D88E1DF1F24
sudo su -c "echo 'deb http://ppa.launchpad.net/git-core/ppa/ubuntu trusty main' > /etc/apt/sources.list.d/git.list"
sudo apt-get update
sudo apt-get install git
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
git : Depends: liberror-perl but it is not installable
Recommends: patch but it is not installable
Recommends: rsync but it is not installable
Recommends: ssh-client but it is not installable
E: Unable to correct problems, you have held broken packages.
我該如何修復它,我該怎麼做才能讓它發揮作用?
答案1
正如您從下面看到的,該git-all
軟體包確實存在於 14.04 上並且確實不是需要 PPA:
andrew@corinth:~$ apt-cache policy git-all
git-all:
Installed: (none)
Candidate: 1:1.9.1-1ubuntu0.3
Version table:
1:1.9.1-1ubuntu0.3 0
500 http://au.archive.ubuntu.com/ubuntu/ trusty-updates/universe amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/universe amd64 Packages
1:1.9.1-1 0
500 http://au.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
andrew@corinth:~$
它位於 Ubuntu 儲存庫的“Universe”部分,因此請確保按照以下路徑啟動它:
Dash --> Software & Updates --> Ubuntu Software --> Community maintained....
請參閱此螢幕截圖,其中滑鼠遊標指示相應的儲存庫:
啟動“Universe”並允許重新載入儲存庫索引後,擺脫 PPA,然後只需執行:
sudo apt-get install git-all
一切都應該很好...