Centos7下下载git

本文介绍了在CentOS7系统下,通过编译方式下载并安装git的详细步骤,包括查看yum源的git版本,下载最新源码,解压编译,配置全局环境变量等过程。
摘要由CSDN通过智能技术生成

查看默认 yum 源的 git版本

# 安装
yum install -y git
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.neusoft.edu.cn
 * extras: mirrors.neusoft.edu.cn
 * updates: mirrors.neusoft.edu.cn
base                                                                                                                                                                                   | 3.6 kB  00:00:00
extras                                                                                                                                                                                 | 2.9 kB  00:00:00
updates                                                                                                                                                                                | 2.9 kB  00:00:00
Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version
Nothing to do

# 查看版本
git version
# git version 1.8.3.1

编译方式安装

1.下载最新版本源码

 

yum install -y wget

Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.neusoft.edu.cn
 * extras: mirrors.neusoft.edu.cn
 * updates: mirrors.neusoft.edu.cn
base                                                                                                                                                                                   | 3.6 kB  00:00:00
extras                                                                                                                                                                                 | 2.9 kB  00:00:00
updates                                                                                                                                                                                | 2.9 kB  00:00:00
Package wget-1.14-18.el7_6.1.x86_64 already installed and latest version
Nothing to do

 

wget -O /tmp/git-2.21.0.tar.gz https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz

--2021-04-25 12:45:48--  https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.21.0.tar.gz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 2604:1380:3000:1500::1, 147.75.95.133
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|2604:1380:3000:1500::1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8289375 (7.9M) [application/x-gzip]
Saving to: ‘/tmp/git-2.21.0.tar.gz’

100%[====================================================================================================================================================================>] 8,289,375   3.83MB/s   in 2.1s

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值