博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
CentOS升级git
阅读量:5837 次
发布时间:2019-06-18

本文共 5528 字,大约阅读时间需要 18 分钟。

1.首先查看下当前的版本

[root@localhost ~]# git --version

git version 1.8.2.1

 

2.尝试进行升级

[root@localhost ~]# yum update git

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirrors.aliyun.com
* base: mirrors.aliyun.com
* epel: mirrors.opencas.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Setting up Update Process
No Packages marked for Update

 

吐槽下,先尝试处理下,发现升级失败。

首先要卸载掉之前安装的git , yum  remove git

然后按照下面的链接来处理

 

3.

1)切换到src目录下

cd /usr/src
2)获取git的源代码
wget https://www.kernel.org/pub/software/scm/git/git-2.0.1.tar.gz
3)解压
tar xzf git-2.0.1.tar.gz

The latest Git version at this time is 2.0.1. To find the latest available version when you follow this guide,

go to this URL  and search for the git-VERSION.tar.gz with the highest version number.

 

ps:2015年10月18日看到的最新版本是2.6.2

 

[root@localhost src]# wget https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz

--2015-10-18 21:21:50-- https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
Resolving www.kernel.org... 198.145.20.140, 199.204.44.194, 149.20.4.69, ...
Connecting to www.kernel.org|198.145.20.140|:443... connected.
ERROR: cannot verify www.kernel.org's certificate, issued by `/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA':
Unable to locally verify the issuer's authority.
To connect to www.kernel.org insecurely, use `--no-check-certificate'.
Unable to establish SSL connection.

 

[root@localhost src]# wget --no-check-certificate https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz

--2015-10-18 21:27:03-- https://www.kernel.org/pub/software/scm/git/git-2.6.2.tar.gz
Resolving www.kernel.org... 198.145.20.140, 199.204.44.194, 149.20.4.69, ...
Connecting to www.kernel.org|198.145.20.140|:443... connected.
WARNING: cannot verify www.kernel.org's certificate, issued by `/C=IL/O=StartCom Ltd./OU=Secure Digital Certificate Signing/CN=StartCom Class 2 Primary Intermediate Server CA':
Unable to locally verify the issuer's authority.
HTTP request sent, awaiting response... 200 OK
Length: 5535091 (5.3M) [application/x-gzip]
Saving to: `git-2.6.2.tar.gz'

100%[===================================================================================================================================================================================================>] 5,535,091 69.7K/s in 4m 36s

2015-10-18 21:31:40 (19.6 KB/s) - `git-2.6.2.tar.gz' saved [5535091/5535091]

You have mail in /var/spool/mail/root

 

 

mail的信息查看

[root@localhost src]# cat /var/spool/mail/root

From root@localhost.localdomain Sun Oct 18 21:26:17 2015
Return-Path: <root@localhost.localdomain>
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by localhost.localdomain (8.13.8/8.13.8) with ESMTP id t9IDQHpi007150
for <root@localhost.localdomain>; Sun, 18 Oct 2015 21:26:17 +0800
Received: (from root@localhost)
by localhost.localdomain (8.13.8/8.13.8/Submit) id t9IDQHOY006874;
Sun, 18 Oct 2015 21:26:17 +0800
Date: Sun, 18 Oct 2015 21:26:17 +0800
Message-Id: <201510181326.t9IDQHOY006874@localhost.localdomain>
To: root@localhost.localdomain
From: logwatch@localhost.localdomain
Subject: Logwatch for localhost.localdomain (Linux)
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset="iso-8859-1"

################### Logwatch 7.3 (03/24/06) ####################
Processing Initiated: Sun Oct 18 21:26:17 2015
Date Range Processed: yesterday
( 2015-Oct-17 )
Period is day.
Detail Level of Output: 0
Type of Output: unformatted
Logfiles for Host: localhost.localdomain
##################################################################
--------------------- Selinux Audit Begin ------------------------

Number of audit daemon stops: 2

---------------------- Selinux Audit End -------------------------

--------------------- Automount Begin ------------------------

**Unmatched Entries**
lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master: 1 Time(s)
---------------------- Automount End -------------------------

--------------------- Kernel Begin ------------------------

WARNING: Kernel Errors Present
hdc: drive_cmd: error=0x04 { AbortedCo ...: 1 Time(s)
hdc: drive_cmd: status=0x51 { DriveReady SeekComplete Error } ...: 1 Time(s)
---------------------- Kernel End -------------------------

--------------------- Connections (secure-log) Begin ------------------------

Userhelper executed applications:
root -> system-config-display as root: 1 Time(s)
---------------------- Connections (secure-log) End -------------------------

--------------------- Smartd Begin ------------------------

**Unmatched Entries**
Problem creating device name scan list
Device: /dev/hda, lacks SMART capability
Device: /dev/hda, to proceed anyway, use '-T permissive' Directive.
Device: /dev/hdc, not ATA, no IDENTIFY DEVICE Structure
---------------------- Smartd End -------------------------

--------------------- SSHD Begin ------------------------

SSHD Killed: 2 Time(s)
SSHD Started: 1 Time(s)
---------------------- SSHD End -------------------------

--------------------- Disk Space Begin ------------------------

Filesystem Size Used Avail Use% Mounted on

/dev/hda1 28G 3.6G 23G 14% /
---------------------- Disk Space End -------------------------

###################### Logwatch End #########################

[root@localhost src]# cd git-2.6.2

再执行下面的命令

make prefix=/usr/local/git all

make prefix=/usr/local/git install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

 最后再git --version

 

转载地址:http://ewjcx.baihongyu.com/

你可能感兴趣的文章
iOS开发小技巧--图片的圆角处理
查看>>
第七章11
查看>>
Java语言基础组成——关键字,标识符,注释,常量和变量,运算符
查看>>
(三十六)类数组对象arguments
查看>>
空字符的类型转换
查看>>
小程序api请求层封装(Loading全局配置)
查看>>
Spring MVC 对于@ModelAttribute 、@SessionAttributes 的详细处理流程
查看>>
2.2 Python基础知识
查看>>
数据类型
查看>>
css对各个浏览器兼容技巧
查看>>
SqlBulkCopy使用介绍以及注意事项
查看>>
DS博客作业03--栈和队列
查看>>
前段基础之CSS
查看>>
上手Caffe(二)
查看>>
为Fragment增加新的生命周期,并实现管理
查看>>
Java虚拟机学习 - 类加载机制
查看>>
Ubuntu在命令行安装显卡驱动
查看>>
WPF Adorner学习(1)
查看>>
linux初始化shell脚本
查看>>
Zabbix Agent端配置文件说明
查看>>