如何在CENTOS 5.5上安装git? [英] How can git be installed on CENTOS 5.5?

查看:155
本文介绍了如何在CENTOS 5.5上安装git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在CENTOS 5.5机器上安装git?
我尝试从yum安装它,但得到了以下msg。

  root @ host [〜]#sudo yum install git 
加载的插件:fastermirror
从缓存的主机文件加载镜像速度
* addons:centos.mirrors.tds.net
* base:mirror.ubiquityservers.com
* extras:mirrors.serveraxis.net
*更新:pubmirrors.reflected.net
addons | 951 B 00:00
base | 2.1 kB 00:00
extras | 2.1 kB 00:00
更新| 1.9 kB 00:00
排除全局排除列表中的软件包
完成
设置安装进程
无可用的包git。
没有做
root @ host [〜]#


解决方案

来源?从回购?最简单的方法是使用回购: sudo yum install git 应该这样做。如果git不是由main提供的,则可能首先需要首先设置额外的repo,例如 EPEL 如果您想从源代码安装,您可以尝试 / install-git-161-on-centos-52 /rel =noreferrer>这些说明。如果你安装了 yum-utils ,它实际上比这更容易**:

  sudo yum build-dep git 
wget http://kernel.org/pub/software/scm/git/<latest-git-source>.tar.gz
tar -xvjf < latest-git> .tar.gz
cd< git>
make(在此之前可能是一个./configure)
sudo make install

**用<> 中包含的部分替换所需的路径。确切的过程可能会有所不同,因为我没有亲自编译git(可能有一个配置脚本)。如果您不知道我在说什么,那么您可能需要按照我的第一个建议从回购站安装。


How can I install git on CENTOS 5.5 machine? I tried to install it from yum but got following msg.

root@host [~]# sudo yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons: centos.mirrors.tds.net
 * base: mirror.ubiquityservers.com
 * extras: mirrors.serveraxis.net
 * updates: pubmirrors.reflected.net
addons                                                   |  951 B     00:00
base                                                     | 2.1 kB     00:00
extras                                                   | 2.1 kB     00:00
updates                                                  | 1.9 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
No package git available.
Nothing to do
root@host [~]#

解决方案

From source? From the repos? The easiest way is to use the repos: sudo yum install git should do it. It may first be necessary to set up an additional repo such as EPEL first if git is not provided by the main repos.

If you want to install from source, you can try these instructions. If you have yum-utils installed it's actually easier than that, too**:

sudo yum build-dep git
wget http://kernel.org/pub/software/scm/git/<latest-git-source>.tar.gz
tar -xvjf <latest-git>.tar.gz
cd <git>
make (possibly a ./configure before this)
sudo make install

**Substitute the portions enclosed in <> with the paths you need. Exact procedure may vary slightly as I have not compiled git from source, personally (there may be a configure script, for example). If you have no idea what I'm talking about, then you may want to just install from the repo as per my first suggestion.

这篇关于如何在CENTOS 5.5上安装git?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆