1、安装依赖包

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

2、下载git源码并解压缩

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

tar -xvf git-2.9.3.tar.gz

cd git-2.9.3

3、编译安装

./configure prefix=/usr/local/git

make

make install

4、填加环境变量

vim /etc/profile

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

5、验证安装是否成功

source /etc/profile

git --version

6、如果出现报错

git: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

先执行ldd /usr/local/git/bin/git看下需要有哪些库

ldd /usr/local/git/bin/git
linux-vdso.so. => (0x00007fffcdf96000)
libz.so. => /lib64/libz.so. (0x0000003beea00000)
libiconv.so. => not found
libcrypto.so. => /lib64/libcrypto.so. (0x00002b4ec5152000)
libcharset.so. => not found
libpthread.so. => /lib64/libpthread.so. (0x0000003361400000)
libc.so. => /lib64/libc.so. (0x0000003360c00000)
libdl.so. => /lib64/libdl.so. (0x0000003361000000)
/lib64/ld-linux-x86-.so. (0x0000003360800000)

执行软连接

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

ln -s /usr/local/lib/libcharset.so.1 /lib64/libcharset.so.1

源码安装git的更多相关文章

  1. linux(centos)源码安装git

    最近使用一个开源库,部署的的时候需要用git克隆依赖库.刚好系统没安装git.就尝试了源码安装git. 源码下载地址:http://codemonkey.org.uk/projects/git-sna ...

  2. Centos下源码安装git

    1.centos下git版本太久了,才1.8几,而官方更新的还是很活跃的,于是我就想源码安装一个新版本. 2.首先到: https://github.com/git/git/releases 下载最新 ...

  3. centos 源码安装git

    (1) 添加rpmforge源 wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686 ...

  4. CentOS6.8使用源码安装Git

    一.安装git所需的依赖 sudo yum groupinstall "Development Tools" sudo yum install gettext-devel open ...

  5. 从源码安装git

    蛋疼的阿里云,git版本居然才1.9.只能手动安装了. 预装 apt-get update apt-get --yes install libcurl4-gnutls-dev libexpat1-de ...

  6. centos源码安装git最新版

    到 git官网下载git 源码安装包,git官网地址:https://www.git-scm.com/ 选择Tarballs系列的安装包,官网git下载:https://mirrors.edge.ke ...

  7. linux平台从源码安装git【转】

    转自:http://blog.csdn.net/lianshaohua/article/details/50571560 版权声明:本文为博主原创文章,未经博主允许不得转载. 如果是ubuntu等能自 ...

  8. centos源码安装git

    因为Centos上yum安装的话可能版本比较低,使用中会有一些难以预料的问题出现. 从源代码编译安装方法: #Centos执行: yum install curl-devel expat-devel ...

  9. 源码安装git工具,显示/usr/local/lib64/libcrypto.a(dso_dlfcn.o) undefined reference to `dlopen'

    /usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':dso_dlfcn.c:(.text+0x30) ...

随机推荐

  1. Python的subprocess模块(二)

    原文:http://blog.chinaunix.net/uid-26000296-id-4461522.html 一.subprocess 模块简介 subprocess最早是在2.4版本中引入的. ...

  2. HTTP API 设计指南(转)

    add by zhj (2014-12-16): 今天才知道,原画HeroKu是国外一个很有名的PaaS提供商,公司很可能会将app迁移到他们那里 英文原文: HTTP API Design Guid ...

  3. GlusterFS部署

    一.GlusterFS简介 PB级容量.高可用.读写性能.基于文件系统级别共享.分布式.无metadata(元数据)的存储方式. GlusterFS(GNU ClusterFile System)是一 ...

  4. linux 下路由配置

    转自 https://www.cnblogs.com/kevingrace/p/6490627.html 在日常运维作业中,经常会碰到路由表的操作.下面就linux运维中的路由操作做一梳理:----- ...

  5. TensorFlow学习笔记(三)MNIST数字识别问题

    一.MNSIT数据处理 MNSIT是一个非常有名的手写体数字识别数据集.包含60000张训练图片,10000张测试图片.每张图片是28X28的数字. TonserFlow提供了一个类来处理 MNSIT ...

  6. 在PL/SQL中如何让程序暂停几秒钟

    在编写PL/SQL中,有时需要程序中暂停几秒钟再继续执行,查了一下,oracle内置有这个功能dbms_lock.sleep(10):不过dbms_lock包需要用户自己安装,演示如下: C:\Doc ...

  7. map::erase陷阱

    map::erase函数在不同版本stl中的差异 1. C++98和C++11标准 http://www.cplusplus.com/reference/map/map/erase/ 2. pj st ...

  8. 深入跟踪MFC程序的执行流程

    来源: http://blog.csdn.net/ljianhui/article/details/8781991 在MFC程序设计的学习过程中最令人感到难受,甚至于有时会动摇学习者信心的就是一种对于 ...

  9. 网站实时信息采集和统计graphite

    Graphite 是一个Python写的web应用,采用django框架,Graphite用来进行收集服务器所有的即时状态,用户请求信息,Memcached命中率,RabbitMQ消息服务器的状态,U ...

  10. AviMemDc: a C++ class

    AviMemDc: a C++ class        This class is used in the Avi Examples.The header fileAviMemDC.h /*    ...