【问题标题】:Trying to install git in Ubuntu Lucid 10.04 LTS尝试在 Ubuntu Lucid 10.04 LTS 中安装 git
【发布时间】:2012-06-25 14:29:45
【问题描述】:

我已经安装了 Git 使用

sudo apt-get install git-core

之后,当我尝试运行 git 时,我得到了

-bash: git: 找不到命令。

我使用的是 Ubuntu 10.04 LTS。

【问题讨论】:

  • 你试过sudo apt-get install git-all,甚至简单的sudo apt-get install git吗?
  • @RudiVerago 不,它说 -bash: /usr/bin/git: 没有这样的文件或目录
  • whereis git 给出了什么?使用dpkg -L git-core你能找到可执行文件吗?
  • @RudiVerago whereis git git: root@me:~# dpkg -L git-core Package `git-core' 未安装。使用 dpkg --info (= dpkg-deb --info) 检查存档文件,使用 dpkg --contents (= dpkg-deb --contents) 列出其内容。
  • ok 未安装 git-core。再次sudo apt-get install git-core

标签: git ubuntu-10.04


【解决方案1】:

刚刚在其他来源找到:

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

这将安装最新的稳定 git 版本。 Ubuntu 的存储库有最旧的。

【讨论】:

    【解决方案2】:

    我不会从 Ubuntu 本身安装包,git 版本将是 1.7.0.4

    我建议使用我的 PPA,因为您将获得最新版本,因为我写这篇文章时它将是 1.7.11.1

    将我的 Ubuntu git 存储库添加到您的系统

    sudo add-apt-repository ppa:pdoes/ppa

    然后你就可以sudo apt-get install git-core

    欲了解更多信息,请访问我的网站:Git Packages for Ubuntu

    【讨论】:

    • Peter - 感谢您的努力 - 目前,您的网站似乎不再支持 Ubuntu 10.04。
    【解决方案3】:

    我遇到了错误

    sudo apt-get install git-core: command not found
    

    添加仓库后

    sudo add-apt-repository ppa:pdoes/ppa
    

    然后运行这个命令,它仍然给我同样的结果。

    sudo apt-get install git-core

    但是这个命令为我做了所有的事情

    sudo apt-get install git-all
    

    【讨论】:

      【解决方案4】:

      参考上面的#3。命令不起作用。

      【讨论】:

        【解决方案5】:
                  sudo apt-get update
                  sudo apt-get install git
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2011-05-15
          • 2012-03-15
          • 2012-05-28
          • 2012-08-04
          • 2012-03-10
          • 2013-02-01
          • 2012-03-17
          • 2013-08-25
          相关资源
          最近更新 更多