准备安装Git
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-devel
#下载git-1.8.5.2.tar.gz 到 /usr/local/src 下载网址 http://code.google.com/p/git-core
cd /root/download
tar -zvxf git-1.8.5.2.tar.gz
cd git-1.8.5.2
./configure --prefix=/usr/local/git
make && make install
报错了吧?
libgit.a(utf8.o):Infunction`reencode_string_iconv':
/root/git-1.8.3.2/utf8.c:530: undefined reference to `libiconv'
libgit.a(utf8.o): In function `reencode_string_len':/root/git-1.8.3.2/utf8.c:569:undefined reference to `libiconv_open'
/root/git-1.8.3.2/utf8.c:588: undefined reference to `libiconv_close'
/root/git-1.8.3.2/utf8.c:582: undefined reference to `libiconv_open'
这是缺少libiconv库
手工安装 libiconv
$cd /root/download
$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
$ make install
再回到 git-1.8.5.2 目录
cd /root/download/git-1.8.5.2
make && make install
安装成功,试一下
git --version
git version 1.8.5.2