首先安装Git依赖的一些包。
yum install zlib-develyum install openssl-develyum install perlyum install cpioyum install expat-develyum install gettext-devel
接下来,如果你已经安装过Curl了,那么跳过这一步,没有的话,就装一下。(可以yum安装)
wget http://curl.haxx.se/download/curl-7.18.0.tar.gztar xzvf curl-7.18.0.tar.gzcd curl-7.18.0./configuremakemake install
确定一下ld.so.conf文件里有/usr/local/lib,这个是为git-http-push准备的。
vi /etc/ld.so.conf
#插入下面的代码
/usr/local/lib
保存文件,接着运行:
/sbin/ldconfig
最后,我们下载Git并安装它
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gztar xzvf git-latest.tar.gzcd git-{date}(这里的{date}指的是版本的时间)autoconf(如果终端提示no command的话就yum install autoconf,千万不要以为文件夹中有makefile就好直接make了,不然会出错的)./configure --with-curl=/usr/localmakemake install
原文:http://blog.haohtml.com/archives/9058
出现错误:
usr/bin/perl Makefile.PL PREFIX='/usr/local/git' INSTALL_BASE='' --localedir='/usr/local/git/share/locale'Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.BEGIN failed--compilation aborted at Makefile.PL line 3.make[1]: *** [perl.mak] Error 2make: *** [perl/perl.mak] Error 2
执行:
yum install perl-ExtUtils-MakeMaker .
行进安装