git安裝--linux下的安裝

通常linux自帶git版本很舊,會有必定問題,能夠先卸載系統自帶git:html

yum remove git
下載及安裝git:linux

wget https://github.com/git/git/archive/v2.2.1.tar.gz
tar zxvf v2.2.1.tar.gz
cd git-2.2.1
make configure
./configure --prefix=/usr/local/git/ --with-iconv=/usr/local/libiconv --with-curl=/home/{username}/curl/
make
make install
echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
source /etc/bashrc

配置curl很重要。 
可能出現的問題,少一些系統庫: 
1.編譯git時報錯: zlib.h: No such file or directory
缺乏 zlib的頭文件, 開發包沒裝,git

yum install zlib (系統默認已經裝上)
yum install zlib-devel

解決github

2.提示make cc Command not foundbash

yum install gcc
3.make[1]: * [perl.mak] Error 2 make: * [perl/perl.mak] Error 2
執行:curl

yum install perl-ExtUtils-MakeMaker package.
進行安裝 
出現錯誤二: 
/bin/sh: msgfmt: command not foundurl

yum install gettext-devel
可解決!.net

4./bin/sh: line 1: asciidoc: command not found
安裝asciidoc: 
到官網下載asciidoc 
http://www.methods.co.nz/asciidoc/index.html 
http://sourceforge.net/projects/asciidoc/code

cp asciidoc-8.5.2.tar.gz /root/src
cd /root/src
tar xvfz asciidoc-8.5.2.tar.gz
cd asciidoc-8.5.2
./configure
sudo make install
5./bin/sh: line 1: xmlto: command not found
xml

yum install xmlto6.若是出現http/https異常,安裝curl

相關文章
相關標籤/搜索