LINUX 下安裝git 超詳細
阿新 • • 發佈:2019-01-03
本文旨在講述如何在linux上安裝最新版的git。1、檢視當前git版本:git --version2、官網下載:(建議本機迅雷下載rz到伺服器,安裝yum install lrzsz後rz即可)解壓:tar -zxvf git-2.11.0.tar.gz3、cd git-2.11.04、為了防止git安裝完後出現git clone時候提示fatal: Unable to find remote helper for 'https'提前先安裝libcurl-develyum install libcurl-devel5、移除舊版本git:yum remove git6、make configure如果報錯/bin/sh: autoconf: command not found:安裝libtool即可:yum install autoconf automake libtool正常會列印:GEN configure執行7、./configure --prefix=/usr/local/git --with-iconv =/usr/local/lib (建議優先嚐試後者)或者./configure --prefix=/usr/local/git --with-iconv --with-curl --with-expat=/usr/local/lib(如果沒有安裝libiconv請自行安裝)make && make install①如果報錯:cache.h:40:18: fatal error: zlib.h: No such file or directory安裝zlib:yum install zlib、yum install zlib-devel②如果報錯:make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2安裝:yum install perl-ExtUtils-MakeMaker package 8、echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc9、source /etc/bashrc10、git --version編譯git時報錯: zlib.h: No such file or directory 缺少 zlib的標頭檔案, 開發包沒裝, yum install zlib (系統預設已經裝上) yum install zlib-devel 原文地址:https://www.cnblogs.com/BinBinStory/p/7113956.html
make: *** [perl/perl.mak] Error 2安裝:yum install perl-ExtUtils-MakeMaker package
3:報錯:make[1]: Leaving directory `/home/app/git-2.5.5/git-gui' 還不知道怎麼解決。