美文网首页
centos 6.5 安装git

centos 6.5 安装git

作者: dream_debug | 来源:发表于2017-11-07 14:28 被阅读0次

    环境准备

    # yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel

    # yum install  gcc perl-ExtUtils-MakeMaker

    下载源码包并解压安装

    #wget https://www.kernel.org/pub/software/scm/git/git-2.9.5.tar.gz

    #tar -zxvf git-2.9.5.tar.gz

    #cd git-2.9.5

    # make configure

    # ./configure --prefix=/usr/local --with-iconv=/usr/local/libiconv

    # make

    # make install

    # sudo vim /etc/profile

    在最后一行添加

    exportPATH=/usr/local/git/bin:$PATH

    保存后使其立即生效

    # source /etc/profile

    查看是否安装成功

    #git --version

    遇到问题

    undefined reference to`libiconv_open'

    undefined reference to`libiconv_close'

    undefined reference to`libiconv_open'

    解决问题步骤

    一.安装libiconv

    # 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  && make install

    二.创建一个软链接到/usr/lib

    # ln -s /usr/local/lib/libiconv.so /usr/lib

    # ln -s /usr/local/lib/libiconv.so.2 /usr/lib

    三.回到git目录继续编译

    # cd git-2.9.5

    # make configure

    # ./configure --prefix=/usr/local --with-iconv=/usr/local/libiconv

    # make

    # make install

    相关文章

      网友评论

          本文标题:centos 6.5 安装git

          本文链接:https://www.haomeiwen.com/subject/rssdmxtx.html