centos7的基础仓库(BASE)中自带1.8.3.1版本的GIT软件包和相应GIT依赖库
可以通过yum provides git查看仓库中git软件包的位置
[xxx@xxx ~]$ yum provides git Loaded plugins: fastestmirror, langpacks Loading mirror speeds from cached hostfile git-1.8.3.1-23.el7_8.x86_64 : Fast Version Control System Repo : base git-1.8.3.1-24.el7_9.x86_64 : Fast Version Control System Repo : updates git-1.8.3.1-25.el7_9.x86_64 : Fast Version Control System Repo : updates git-1.8.3.1-25.el7_9.x86_64 : Fast Version Control System Repo : @updates
执行以下命令安装GIT
安装GIT依赖库
yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel yum install gcc perl-ExtUtils-MakeMaker
安装过程中输入 Y 默认安装git1.8.3.1版本,或者输入 N 只安装依赖库
安装完成后,查看安装成功的默认版本
yum git info
不想使用默认版本也可以通过以下命令移除默认版本
yum remove git
由于之前已经安装好git对应的依赖库,现在