本文介绍了在Ubuntu中安装最新版本的git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前的git版本为1.7.9.5 ...

我需要升级至少git 1.7.10才能有 git clone 命令正常工作



我试过 sudo add-apt-repository ppa:git-core / ppa

  Traceback(最近一次调用最后一次):
文件/ usr / bin / add-apt-repository,第125行,位于< module>
ppa_info = get_ppa_info_from_lp(user,ppa_name)
文件/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py,第80行,位于get_ppa_info_from_lp
curl.perform ()
pycurl.error:(7,无法连接到主机)

我该怎么做才能安装最新的git(升级)? 只是为了那个

  ppa:git-core / ppa 

只要做到:

  sudo add-apt-repository ppa:git-core / ppa 
sudo apt-get update $ b $ sudo apt-get install git

如果找不到 add-apt-repository 命令,请先使用

b
$ b

  sudo apt-get install software-properties-common python-software-properties 


My Current git version 1.7.9.5...

I need to upgrade to at least git 1.7.10 to have git clone command to work properly

I tried sudo add-apt-repository ppa:git-core/ppa for upgrading but resulted in this :

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")

What am I supposed to do to get the latest git installed (to upgrade)?

解决方案

The Ubuntu git maintainers team has a PPA just for that

ppa:git-core/ppa

Just do:

sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git

If add-apt-repository command is not found, install it first with

sudo apt-get install software-properties-common python-software-properties

这篇关于在Ubuntu中安装最新版本的git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 23:43