Linux-CentOS7.6下源码编译安装Git-2.20.1

Linux-CentOS7.6下安装Git-2.20.1

官网安装说明

https://git-scm.com/book/zh/v2/起步-安装-Git

源码安装

安装依赖

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

注意最后的2X大写

sudo yum install asciidoc xmlto docbook2X
sudo yum install autoconf automake libtool
sudo ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi
sudo ln -s /usr/bin/db2x_docbook2man /usr/bin/docbook2x-man

下载git-2.20.1

mkdir -p /data0/software
cd /data0/software

wget -O git-2.20.1.tar.gz https://github.com/git/git/archive/v2.20.1.tar.gz

编译安装

tar -zxf git-2.20.1.tar.gz
cd git-2.20.1
make configure
./configure --prefix=/usr
make all doc info
sudo make install install-doc install-html install-info

make configure 报错

/bin/sh: autoconf: command not found

解决

yum install autoconf automake libtool

查看版本

git --version

你可能感兴趣的:(Linux)