CentOS下源码安装Git

安装依赖

1
yum install wget gcc gcc-c++ g++ autoconf autoconf2.13 automake make cmake m4 openssl openssl-devel curl libcurl-devel zlib-devel libxml2-devel gettext-devel gdbm-devel readline-devel ncurses-devel libffi-devel libyaml-devel libxslt-devel libicu-devel logrotate python-docutils krb5-devel

安装Git

1
2
3
4
5
6
7
8
9
10
11
# yum install gettext-devel asciidoc xmlto perl-ExtUtils-MakeMaker
# rpm -qa | grep -i git
# rpm -e git-1.8.3.1-6.el7_2.1.x86_64 --nodeps //一定要移除旧版本,因为旧版本没有-C选项
# wget https://www.kernel.org/pub/software/scm/git/git-2.13.2.tar.gz
# tar -xzf git-2.13.2.tar.gz
# cd git-2.13.2/
# ./configure --prefix=/usr/local/git
# make all doc
# make install
# ln -s /usr/local/git/bin/git /usr/bin/git
# git --version

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :