centos 原始碼安裝最新Git

2021-09-13 03:49:20 字數 1811 閱讀 2315

git 的工作需要呼叫 curl,zlib,openssl,expat,libiconv 等庫的**,所以需要先安裝這些依賴工具。在有 yum 的系統上(比如 fedora)或者有 apt-get 的系統上(比如 debian 體系),可以用下面的命令安裝:

yum install curl-devel expat-devel gettext-devel  openssl-devel zlib-devel

wget 

tar -zxvf git-2.21.0.tar.gz

cd git-2.21.0

cd git-2.21.0

./configure --with-openssl=/usr/local/openssl

make prefix=/usr/local/git all

make prefix=/usr/local/git install

echo

"export path=$path:/usr/local/git/bin"

>> /etc/bashrc

source /etc/bashrc

git --version

# git version 2.21.0

imap-send.o: in function `sk_general_name_num':

/usr/local/include/openssl/x509v3.h:165: undefined reference to `openssl_sk_num'

imap-send.o: in function `sk_general_name_value':

/usr/local/include/openssl/x509v3.h:165: undefined reference to `openssl_sk_value'

imap-send.o: in function `sk_general_name_pop_free':

/usr/local/include/openssl/x509v3.h:165: undefined reference to `openssl_sk_pop_free'

/usr/local/include/openssl/x509v3.h:165: undefined reference to `openssl_sk_pop_free'

imap-send.o: in function `ssl_socket_connect':

/usr/local/src/git-2.11.1/imap-send.c:287: undefined reference to `openssl_init_ssl'

/usr/local/src/git-2.11.1/imap-send.c:288: undefined reference to `openssl_init_ssl'

/usr/local/src/git-2.11.1/imap-send.c:290: undefined reference to `tls_method'

/usr/local/src/git-2.11.1/imap-send.c:303: undefined reference to `ssl_ctx_set_options'

collect2: error: ld returned 1 exit status

make: *** [git-imap-send] error 1

openssl問題,自帶的是openssl 1.0.1e-fips 11 feb 2013,把它公升級到了openssl-1.1.0d。從新編譯安裝

linux 原始碼安裝最新git

1 如果系統中有舊的git 跳過第一步,否則先安裝 sudo apt get install git core sudo apt get install libcurl4 gnutls de git clone git git.kernel.org pub scm git git.git 3 進入g...

CentOS原始碼安裝PHP

先安裝需要的庫 yum y install libxml2 yum y install libxml2 devel yum y install gd yum y install gd devel yum y install curl curl devel yum y install libjpeg ...

CentOS 原始碼安裝PHP

2 解壓縮並且進入解壓縮後的檔案目錄下 4 make make install 遇到問題 1 configure error xml2 config not found.please check your libxml2 installation 參看 安裝php時的報錯 checking libx...