今天在centos 中安装git 1.9.4 时报错了。
报错内容如下:
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 2
make: *** [perl/perl.mak] Error 2
网上查了一下解决方法是:
yum install perl-ExtUtils-MakeMaker -y
手动安装git
一、安装前准备:
yum install curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel -y
二、下载git安装包
https://www.kernel.org/pub/software/scm/git/git-1.9.4.tar.gz
三、打开Terminal
[root@localhost workspace]# cd ~/Downloads/ enter
[root@localhost workspace]# tar zxf git-1.9.4.tar.gz
[root@localhost workspace]# cd git-1.9.4
执行
[root@localhost workspace]# .
/configure
--prefix=
/usr/local/git/
[root@localhost workspace]# make
[root@localhost workspace]# make install
如果make出现上述错误 执行yum install perl-ExtUtils-MakeMaker -y
然后在重新执行./configure ......
安装完成后安装目录在/usr/local/git/
四、配置环境变量
vim
/etc/profile
export
GIT_HOME=
/usr/local/git/
export
PATH=$PATH:$GIT_HOME
/bin
git version 1.9.4