centos中安裝、升級git

yum install git如果從老版本升級,則按下面方法。(centos中)先更新系統sudo yum update    安裝依賴的包yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker下載git源碼並解壓縮wget https://github.com/git/git/archive/v2.3.0.zipunzip v2.3.0.zipcd git-2.3.0make prefix=/usr/local/git allmake prefix=/usr/local/git install在這可能會相似下面的錯誤:/root/git/git-2.3.0/utf8.c:463: undefined reference to `libiconv'而後按後面的方法解決。安裝成功後git --version,若不是新版本,則要把編譯安裝的git路徑放到環境變量裏查看git所在的路徑:whereis gitgit: /usr/bin/git /usr/local/git /usr/share/man/man1/git.1.gz第二個便是git的路徑vi /etc/profile    在最後加:export PATH=/usr/local/git/bin:$PATH從新加載source /etc/profilegit --versiongit version 2.3.0大功告成。------------------安裝libiconvcd && wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gztar -zxvf libiconv-1.14.tar.gzcd libiconv-1.14./configure --prefix=/usr/local/libiconv  &&  make  && make install建立一個軟連接到/usr/libln -s /usr/local/lib/libiconv.so /usr/libln -s /usr/local/lib/libiconv.so.2 /usr/lib而後回到git目錄繼續編譯cd /usr/local/gitmake configure./configure --prefix=/usr/local --with-iconv=/usr/local/libiconvmakemake install
相關文章
相關標籤/搜索