解决CentOS 7源码安装git【解决】报错问题

72 阅读1分钟

问题

[root@LAPTOP-CHOA4ICV download]# cd git-2.9.5 && make prefix=/usr/local/git all && make prefix=/usr/local/git install
CC http.o
In file included from http.c:2:0:
http.h:6:23: fatal error: curl/curl.h: No such file or directory
#include <curl/curl.h>

解决办法 

yum -y install curl-devel

问题

[root@LAPTOP-CHOA4ICV download]# cd git-2.9.5 && make prefix=/usr/local/git all && make prefix=/usr/local/git install
CC http.o
CC http-walker.o
CC http-fetch.o
LINK git-http-fetch
CC http-push.o
http-push.c:18:19: fatal error: expat.h: No such file or directory
#include <expat.h>
^
compilation terminated.
make: *** [http-push.o] Error 1

解决办法

yum install expat-devel

 问题

/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 package.