首页 > 代码库 > CentOS服务器安装 Git 2.2.0
CentOS服务器安装 Git 2.2.0
#yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
##wget https://github.com/git/git/archive/v2.2.0.tar.gz
#tar zxvf git-2.2.0.tar.gz
#cd git-2.2.0
#make prefix=/usr/local all
#make prefix=/usr/local install #root用户运行
如果编译时提示错误:
LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv’:
/opt/git-master/utf8.c:530: undefined reference to `libiconv’
libgit.a(utf8.o): In function `reencode_string_len’:
/opt/git-master/utf8.c:569: undefined reference to `libiconv_open’
/opt/git-master/utf8.c:588: undefined reference to `libiconv_close’
/opt/git-master/utf8.c:582: undefined reference to `libiconv_open’
collect2: ld 返回 1
make: *** [git-credential-store] 错误 1
解决办法:
cd /usr/local/src/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure -prefix=/usr/local/libiconv && make && sudo make install
然后回到git继续编译:
cd /usr/local/src/git-1.8.5
make configure
./configure --prefix=/usr/local -with-iconv=/usr/local/libiconv
make
make install
##wget https://github.com/git/git/archive/v2.2.0.tar.gz
#tar zxvf git-2.2.0.tar.gz
#cd git-2.2.0
#make prefix=/usr/local all
#make prefix=/usr/local install #root用户运行
如果编译时提示错误:
LINK git-credential-store
libgit.a(utf8.o): In function `reencode_string_iconv’:
/opt/git-master/utf8.c:530: undefined reference to `libiconv’
libgit.a(utf8.o): In function `reencode_string_len’:
/opt/git-master/utf8.c:569: undefined reference to `libiconv_open’
/opt/git-master/utf8.c:588: undefined reference to `libiconv_close’
/opt/git-master/utf8.c:582: undefined reference to `libiconv_open’
collect2: ld 返回 1
make: *** [git-credential-store] 错误 1
解决办法:
cd /usr/local/src/
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz
tar -zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure -prefix=/usr/local/libiconv && make && sudo make install
然后回到git继续编译:
cd /usr/local/src/git-1.8.5
make configure
./configure --prefix=/usr/local -with-iconv=/usr/local/libiconv
make
make install
CentOS服务器安装 Git 2.2.0
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。