首页 > 其他 > 详细

Centos7 从 git version 1.8.3.1升级git version 2.32.0 全过程

时间:2021-08-12 23:23:00      阅读:14      评论:0      收藏:0      [点我收藏+]

安装安装依赖软件

[root@localhost ~]# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.163.com

================================================
============省略一大堆不需要操作的过程=============
================================================

Installed:
gettext-devel.x86_64 0:0.19.8.1-3.el7

Complete!
[root@localhost ~]# yum install gcc perl-ExtUtils-MakeMaker
================================================
============省略一大堆不需要操作的过程=============
================================================

卸载之前安装的版本


[root@localhost ~]# git --version
git version 1.8.3.1
[root@localhost ~]# yum remove git
Loaded plugins: fastestmirror
Resolving Dependencies
================================================
============省略一大堆不需要操作的过程=============
================================================

 

下载软件


[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.32.0.tar.xz
--2021-08-12 09:37:01-- https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.32.0.tar.xz
Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.95.133, 2604:1380:3000:1500::1
Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.95.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6551348 (6.2M) [application/x-xz]
Saving to: ‘git-2.32.0.tar.xz’

100%[===========================================================================================>] 6,551,348 55.4KB/s in 1m 46s

2021-08-12 09:38:49 (60.3 KB/s) - ‘git-2.32.0.tar.xz’ saved [6551348/6551348]
[root@localhost src]# ls
git-2.32.0.tar.xz
[root@localhost src]# tar -xf git-2.32.0.tar.xz
[root@localhost src]# cd git-2.32.0/
[root@localhost git-2.32.0]# make prefix=/usr/local/git all
[root@localhost git-2.32.0]# make prefix=/usr/local/git install
[root@localhost git-2.32.0]# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile
[root@localhost git-2.32.0]# source /etc/profile
[root@localhost git-2.32.0]# git --version
git version 2.32.0

如果只是希望当前账户使用该版本则做如下操作


[root@localhost git-2.32.0]# echo "export PATH=$PATH:/usr/local/git/bin" >> ~/.bashrc
[root@localhost git-2.32.0]# source ~/.bashrc
[root@localhost git-2.32.0]# git --version
git version 2.32.0

Centos7 从 git version 1.8.3.1升级git version 2.32.0 全过程

原文:https://www.cnblogs.com/Release-R/p/15135081.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!