[英]pip unexpectedly not installing latest version of git package with branch/commit pinning
[英]Installing Latest version of git in ubuntu
我當前的 git 版本 1.7.9.5...
我需要至少升級到 git 1.7.10 才能讓git clone
命令正常工作
我嘗試sudo add-apt-repository ppa:git-core/ppa
進行升級,但結果如下:
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 125, in <module>
ppa_info = get_ppa_info_from_lp(user, ppa_name)
File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp
curl.perform()
pycurl.error: (7, "couldn't connect to host")
我應該怎么做才能安裝最新的 git(升級)?
ppa:git-core/ppa
只需這樣做:
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
如果找不到add-apt-repository
命令,請先安裝它
sudo apt-get install software-properties-common python-software-properties
問題是:“當sudo add-apt-repository ppa:git-core/ppa
命令失敗時該怎么辦”。
我在代理后面的虛擬機中遇到了同樣的問題。 我通過以下兩個步驟解決了它:
設置代理環境變量
export http_proxy=http://<user>:<pwd>@<proxy_url>:<port_number> export https_proxy=http://<user>:<pwd>@<proxy_url>:<port_number>
再次以 sudo 身份運行add-apt-repository
命令,並使用-E
選項保留用戶環境:
sudo -E add-apt-repository ppa:git-core/ppa
只需按照以下命令更新最新版本的 git
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
或超級手動方法
從 git hub 下載 git 源,然后
make prefix=/usr/local all
sudo make prefix=/usr/local install
https://www.digitalocean.com/community/tutorials/how-to-install-git-on-ubuntu-14-04
要在最新版本的 Ubuntu 中安裝或更新 Git,只需在終端中鍵入以下命令並按回車鍵(返回)。
sudo apt-get install git
用於檢查 Git 版本。
git --version
在 Ubuntu 中安裝 Git
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.