CentOS 5 's Yum source does not have git, can only compile the installation itself, now record the content of the compilation and installation and error resolution, left to their own memo.
Compiling a basic Environment environment
Ensure that the dependent packages are installed
| 1 |
Yum install-y Curl curl-devel zlib-devel openssl-devel perl perl-devel cpio expat-devel Gettext-devel |
Download the latest Git package
| 1 |
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz |
| 2 |
Tar xzvf git-latest.tar.gz |
| 3 |
CD git-2012-07-05 # Your directory may not be this |
Check the installed version, done
| 1 |
[Root@cobbler git-2012-07-05]# git--version |
Compile with error message and workaround:
MAKE[1]: Warning:file ' Makefile ' have modification time 3e+06 s in the future
/usr/bin/perl makefile.pl prefix= '/usr/l Ocal ' install_base= '--localedir= '/usr/local/share/locale '
Writing perl.mak for Git
make[1]: Warning: Clock skew detected. Your build may incomplete.
GEN git-add--interactive
make[1]: Warning:file ' Makefile ' have modification time 3e+06 s in the future
Writing per L.mak for Git
make[2]: Warning:file ' makefile.pl ' have modification time 3e+06 s in the future use of
Uninitialize D value $localedir in concatenation (.) or string at makefile.pl line.
Writing Perl.mak for Git
make[2]: * * [Perl.mak] Error 1
make[1]: * * * [Instlibdir] Error 2 Make
: * * * [git-a Dd--interactive] Error 2
on the web search for some, according to the error of warning discovery is the machine time setting problem. The time of the machine system is earlier than the version time. So you have to reset the system time.
Since there is already a git version in the Yum source in CentOS6, you can install it directly using the Yum source
| 3 |
The current git version in Yum source is as follows |
| 4 |
[Root@cobbler ~]# git--version |
There may be an error: Git:error while loading shared libraries:libiconv.so.2:cannot open Shared object file:no such file or directory
Here's how to fix it:
Recently upgraded the Iconv library impact. Under/usr/local/lib can find libiconv.so.2, add/usr/local/lib to the path also not.
Method One:
Add a row of/usr/local/lib in/etc/ld.so.conf and run Ldconfig. Run Apache,ok again.
Ld.so.conf and Ldconfig are maintenance system dynamic link libraries. I don't understand why the Iconv library does not take this step when it is installed.
Method Two:
Ln-sf/usr/local/lib/libiconv.so.2/usr/lib/libiconv.so.2
Build and install Git under CENTOS
1. First of all, the compilation and installation method, preparation before installation
Yum-y Install Zlib-devel openssl-devel perl cpio expat-devel gettext-devel OpenSSL zlib Curl autoconf tk
wget http://git-core.googlecode.com/files/git-1.7.10.tar.gz
2. Install git
Tar zxf git-latest.tar.gz
CD Git-{date} I am here for the git-2012-04-17 version, so my command is CD git-2012-04-17/
Autoconf
./configure
Make
Make install
Make and make install is best done separately here, lest there is any mistake.
Git--version
git version 1.7.10