CentOS6.5升级git版本
2016-12-05 14:35
519 查看
1.执行如下命令查看git版本:
git --version
结果如下:
git version 1.7.1
从git的官方网站上可以看到,目前git的最新版本已经到了2.11,我们机器上的git版本太低
2.配置163网络yum源
参考下面的文章进行配置即可:CentOS配置163yum源
3.下载配置Git新版本yum源脚本
vim git_repo_install.sh
#!/bin/bash el5_download_install(){ wget -O /tmp/release.rpm ${1} yum -y localinstall /tmp/release.rpm rm -f /tmp/release.rpm } centos_install_epel(){ # CentOS has epel release in the extras repo yum -y install epel-release import_epel_key } rhel_install_epel(){ case ${RELEASE} in 5*) el5_download_install https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm;; 6*) yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm;; 7*) yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm;; esac import_epel_key } import_epel_key(){ case ${RELEASE} in 5*) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL;; 6*) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6;; 7*) rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7;; esac } centos_install_ius(){ case ${RELEASE} in 5*) el5_download_install https://centos5.iuscommunity.org/ius-release.rpm;; 6*) yum -y install https://centos6.iuscommunity.org/ius-release.rpm;; 7*) yum -y install https://centos7.iuscommunity.org/ius-release.rpm;; esac import_ius_key } rhel_install_ius(){ case ${RELEASE} in 5*) el5_download_install https://rhel5.iuscommunity.org/ius-release.rpm;; 6*) yum -y install https://rhel6.iuscommunity.org/ius-release.rpm;; 7*) yum -y install https://rhel7.iuscommunity.org/ius-release.rpm;; esac import_ius_key } import_ius_key(){ rpm --import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY } if [[ -e /etc/redhat-release ]]; then RELEASE_RPM=$(rpm -qf /etc/redhat-release) RELEASE=$(rpm -q --qf '%{VERSION}' ${RELEASE_RPM}) case ${RELEASE_RPM} in centos*) echo "detected CentOS ${RELEASE}" centos_install_epel centos_install_ius ;; redhat*) echo "detected RHEL ${RELEASE}" rhel_install_epel rhel_install_ius ;; *) echo "unknown EL clone" exit 1 ;; esac else echo "not an EL distro" exit 1 fi
4.卸载老版本Git:
su yum remove git
5.执行脚本安装:
sh git_repo_install.sh
6.安装新版本Git:
yum install git2u-daemon
7.检查安装版本:
git --version
结果如下:
git version 2.10.2
git版本已经更新成功!
相关文章推荐
- Centos 6.5 Git版本升级
- Centos 6.5升级git版本的办法
- CentOS6.5升级Git版本
- Centos6.5 python升级成2.7版本出现的一些问题解决方法
- CentOS6.5升级autoconf版本 Autoconf version 2.64 or higher is required
- CentOS6.5升级autoconf版本 Autoconf version 2.64 or higher is required
- centos 6.5 升级php到5.6.17版本
- 在centos6.5 64bit环境下安装最新版本的git
- CentOS6.5 升级 Python 2.7 版本
- CentOS6.5在已有低版本环境下安装升级Apache+MySQL+PHP
- centos 升级git到高级版本
- Centos 6.5升级到Git2.1.2
- Linux---centos升级git版本
- centos 6.5 升级 git 1.9
- CentOS6.5 Openssl版本升级
- Centos6.5将git 1.7.1升级到git 2.2.1
- Centos 6.5 Git1.7.1升级到Git2.2.1
- centos6.5 phpmyadmin 您应升级到 MySQL 5.5.0 或更高版本
- CentOS6.5升级autoconf版本,解决”Autoconf version 2.64 or higher is required“错误