Original Address: https: //blog.csdn.net/u010887744/article/details/53957613 [label] bulk
1, view the current version of git: git --version
View the latest version of git: Access https://www.kernel.org/pub/software/scm/git/
or https://github.com/git/git/releases
2, the official website to download:
wget HTTPS: // Github. COM / the Git / the Git / Archive / v2.22.0.tar.gz
(rz Thunder download native recommendation to the server, after the installation can yum install lrzsz rz)
extracting: the tar-2.22.0.tar.gz -zxvf Git
. 3, 2.22.0 git-cd
4, remove the old version git: git yum the remove
5, the make the configure
if an error / bin / sh: autoconf: command not found:
install libtool to: yum install install autoconf automake libtool
normal print: GEN configure
performed
6,. / configure --prefix = / usr / local / git --with-iconv = / usr / local / lib ( the latter attempt recommendation priority)
or
./configure --prefix = / usr / local / git --with-iconv --with-curl --with- expat = / usr / local / lib ( if not install libiconv installed your own)
the make the make the install &&
① If the error: cache.h: 40: 18: fatal error: zlib.h: No such file or directory
is mounted zlib: the install zlib yum, yum the install zlib-devel
② If the error: make [1]: *** [ perl .mak] Error 2
installed: yum install perl-ExtUtils-MakeMaker package
7、echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
8、source /etc/bashrc
9、git --version
Git error when compiling: zlib.h: No such file or directory
missing zlib header files, development kits not installed,
yum install zlib (default already installed)
yum install zlib-devel
git clone时候提示fatal: Unable to find remote helper for 'https'
yum install libcurl-devel
git: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
This is because the library can not be loaded libiconv.so.2.
Solution:
# echo "/usr/local/lib" >> /etc/ld.so.conf # /sbin/ldconfig
Download path 1.libiconv package
Download page package http://www.gnu.org/software/libiconv/
wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.16.tar.gz
2. compile and install libiconv library
$tar zxvf libiconv-1.16.tar.gz
$cd libiconv-1.16
$ ./configure --prefix=/usr/local
$ make
$ make install
In the / usr / local / lib / directory, copy prepared by the library file libcharset.so.1 needs, libiconv.so.2.
": Libiconv.so.2 error while loading sharedlibraries" error, the solution is 3. -liconv call libiconv dynamic library files in makefiel file, if there:
$updatedb
$locate libiconv.so.2
Found that the library has been installed, the location of the /usr/local/lib/libiconv.so.2. Now that you have installed, why not able to find? Next to continue the investigation.
$ strace ./indexer to print out and file name of the program called when all indexer starts
in the output information found libiconv.so.2 library to find the path is / lib directory and / usr / lib these two directories.
Well, the problem is found, the / usr / local / lib below the library is linked to / usr / lib to below
$ ln -s /usr/local/lib/libiconv.so.2 /usr/lib/libiconv.so .2
$ldconfig
git: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
This is because the library can not be loaded libiconv.so.2.
Solution:
# echo "/usr/local/lib" >> /etc/ld.so.conf # /sbin/ldconfig