【问题标题】:How to install git 1.8 or above on Debian Wheezy如何在 Debian Wheezy 上安装 git 1.8 或更高版本
【发布时间】:2014-08-01 20:55:50
【问题描述】:

我正在尝试安装更高版本的 git(主要是 1.8.* 或更高版本)。如果我尝试使用apt-get install git 安装它,我最终会安装版本1.7.10.4

我已经尝试使用以下方法更改存储库:

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

apt-get update 的输出只是给了我以下信息,因此,我最终再次安装了版本 1.7.10.4

W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/source/Sources  404  Not Found
W: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/wheezy/main/binary-amd64/Packages  404  Not Found

我也尝试过使用 backport 安装 git,如下所示:

sudo apt-get install git/wheezy-backports
sudo apt-get -t wheezy-backports install git

我永远不会比apt-get install git/wheezy-backports 走得更远,因为我最终会收到以下错误:

E: Release 'wheezy-backports' for 'git' was not found

如何在 Debian Wheezy 上安装 git 1.8.* 或更高版本?

【问题讨论】:

    标签: git debian


    【解决方案1】:

    我肯定会推荐使用 backports 版本。要使用 backports 存储库,请记住,您必须将以下行添加到 /etc/apt/sources.list:

    deb http://http.debian.net/debian wheezy-backports main
    

    然后您可以使用 apt-get 重试。你可以在http://backports.debian.org/Instructions/#index2h2找到完整的说明

    【讨论】:

    • 我首先错过了 'apt-get -t squeeze-backports install "package"' 的需要 - 即使用链接后面指示的 -t 标志,否则 apt-get 将找不到它.现在在 git 1.9.1。谢谢
    • 在 source.list 中添加了 backports url,正如@gheesh 所说并触发,命令,add-apt-repository ppa:git-core/ppa apt-get update apt-get install git 对我有用完美,检查 git --version ,它返回: git version 1.7.10.4 ,谢谢
    【解决方案2】:

    让我提供一个干净的复制/粘贴解决方案:

    echo "deb http://http.debian.net/debian wheezy-backports main" >/etc/apt/sources.list.d/wheezy-backports.list
    sudo apt-get update -qq
    sudo apt-get -t wheezy-backports install -y -qq git mercurial
    

    【讨论】:

    • 仅供参考,在评论时重新设置在 git 1.9.1 中。对我来说已经足够好了!
    • 谢谢,接受的答案对我有用,但我忘了更新,你提醒了我。
    【解决方案3】:

    从它的 repo https://github.com/git/git 克隆它并自己编译它。我在 Cygwin 上做过,很简单,所以在 Debian 上应该没问题。阅读 INSTALL 文件,它是不言自明的。

    如果您之前没有编译过软件,那么您应该知道将需要很多先决条件(它们在安装中列出)。你应该可以apt-get他们。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-28
      • 2013-11-30
      • 1970-01-01
      • 1970-01-01
      • 2016-01-31
      • 2018-03-22
      相关资源
      最近更新 更多