本文以AlamLinux9.1 minmal env,且能连上公网为例。
RedHat系列.
1.找到最新的git安装链接
https://mirrors.edge.kernel.org/pub/software/scm/git/
2.git安装命令
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.9.5.tar.xz #必须能连上公网
tar -xzvf git-2.9.5.tar.xz
cd git-2.9.5
./configure --prefix=/usr/local #这一步不用执行好像也行
make
sudo make install
git --version
2.1 make 执行时出错解决
2.1.1 fatal error: openssl/ssl.h: No such file or directory
yum install -y openssl-devel
2.1.2 fatal error: zlib.h: No such file or directory
yum install -y openssl-devel
2.1.3 fatal error: curl/curl.h: No such file or directory
yum install curl-devel
2.1.4 fatal error: /usr/bin/perl: No such file or directory
yum -y install gcc gcc-c++ perl make kernel-headers kernel-devel
可能会提示:Cannot find a valid baseurl for repo: base/7/x86_6 这是因为没有网!