Upgrade git from 1.7.1 to 1.7.12.4 on centos
Abstract: This article records the process of upgrading git from 1.7.1 to 1.7.12.4 on centos6.3.
1. Overview
The upgrade was conducted on July 15, June 10 this year and is available for future reference only today.
In my project, on centos 6.3, the first installed git is 1.7.1. After nearly a year, I want to upgrade git to the latest version.
2. Upgrade process
Before getting started, you must first find the information, read the document, and understand that it is not too late. If you make a mistake, you may have to make a detour. I listed the documents that I can find as a basis for reference.
At that time, the latest version of git was 1.8.8, but I don't know which installation library contains it. From the references [1] and [2], you can only upgrade to 1.7.12.4. Another approach is to download the latest source code so that you can compile and install it to version 1.8. However, it is the first time you have done this, so don't bother.
2.1 install rpmforge
Log on to the server using SSH and run the following command. Note that the command lines in this document must be performed under the root permission of the Linux super administrator.
# rpm -i ‘http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm‘# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
After the installation is complete, all the libraries in rpmforge are closed and will not work during installation or upgrade with Yum or RPM. Therefore, we need to enable the libraries that contain the GIT installation package.
2.2 enable rpmforge-extras Library
Use a text editor (Vi, Vim, gedit, etc.) to open the file/etc/yum. repos. d/rpmforge. repo, find [rpmforge-extras], and change enabled = 0 to Enabled = 1, as shown below:
### Name: RPMforge RPM Repository for RHEL 6 - dag### URL: http://rpmforge.net/[rpmforge]# ...[rpmforge-extras]name = RHEL $releasever - RPMforge.net - extrasbaseurl = http://apt.sw.be/redhat/el6/en/$basearch/extrasmirrorlist = http://mirrorlist.repoforge.org/el6/mirrors-rpmforge-extras#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge-extrasenabled = 1protect = 0gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-daggpgcheck = 1[rpmforge-testing]# ...
2.3 upgrade git
The following process is simple. You only need to use the yum update command to upgrade the GIT package:
# Yum update git
More display and options are omitted ......
17 packages downloaded and installed
More display and options are omitted ......
Follow the prompts. Basically, you only need to press enter to confirm the default option. As shown above, a total of 17 packages were downloaded and installed during my upgrade.
After that, check the GIT version:
# git --versiongit version 1.7.12.4
You can see that git has been upgraded from 1.7.1 to 1.7.12.4.
2.4 close the rpmforge-extras library and clear
After the upgrade, close the rpmforge-extras library. Similar to Step 2.2, open/etc/yum in a text editor. repos. d/rpmforge. repo, find [rpmforge-extras], and change enabled = 1 to Enabled = 0, as shown below:
### Name: RPMforge RPM Repository for RHEL 6 - dag### URL: http://rpmforge.net/[rpmforge]# ...[rpmforge-extras]# ...enabled = 0# ...[rpmforge-testing]# ...
Finally, clear the yum cache:
# yum clean all
A. References
- How to upgrade git version> = 1.7.10 on centos 6
Http://tecadmin.net/how-to-upgrade-git-version-1-7-10-on-centos-6/
- How to install latest version of Git on centos 6.x
Http://stackoverflow.com/questions/21820715/how-to-install-latest-version-of-git-on-centos-6-x
The above two methods are similar. They are all installed in the rpmforge installation library and upgraded to git 1.7.12.4.
- How to install git 1.8.5.3 on centos/RHEL 6
Http://tecadmin.net/install-git-1-8-on-centos-rhel/
This article describes how to download the source code of git 1.8 and then compile and install it.