我想在Redhat6中安裝git。 我正在關注how to install git本教程。如何在Redhat 6.x/7.x中安裝最新版本的git
# cd /usr/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.0.5.tar.gz
# tar xzf git-2.0.5.tar.gz
# cd git-2.0.5
# 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 zip文件。 但是當我執行這個命令。
make prefix=/usr/local/git all
我得到這個錯誤
[[email protected] git-2.0.5]# make prefix=/usr/local/git all
GIT_VERSION =2.0.5
* new build flags
CC credential-store.o /bin/sh: cc:
command not found make: *** [credential-store.o] Error 127
如何解決這個問題?
我能夠使用yum install git
安裝git。但默認情況下1.7.1正在安裝。但我想上面安裝2
編輯1 當我執行
yum groupinstall 'Development Tools'
它下載所需的依賴和上面的錯誤消失。
現在,當我執行此make prefix=/usr/local/git all
我得到波紋錯誤
CC bulk-checkin.o
In file included from cache.h:4,
from bulk-checkin.h:7,
from bulk-checkin.c:4:
git-compat-util.h:213:25: warning: openssl/ssl.h: No such file or directory
git-compat-util.h:214:25: warning: openssl/err.h: No such file or directory
git-compat-util.h:320:25: warning: openssl/evp.h: No such file or directory
git-compat-util.h:321:26: warning: openssl/hmac.h: No such file or directory
git-compat-util.h:323:28: warning: openssl/x509v3.h: No such file or directory
In file included from bulk-checkin.h:7,
from bulk-checkin.c:4:
cache.h:11:21: warning: openssl/sha.h: No such file or directory
In file included from bulk-checkin.c:5:
csum-file.h:11: error: expected specifier-qualifier-list before ‘SHA_CTX’
csum-file.h:23: error: expected specifier-qualifier-list before ‘SHA_CTX’
bulk-checkin.c:96: error: expected declaration specifiers or ‘...’ before ‘SHA_CTX’
bulk-checkin.c: In function ‘stream_to_pack’:
bulk-checkin.c:128: warning: implicit declaration of function ‘SHA1_Update’
bulk-checkin.c:128: error: ‘ctx’ undeclared (first use in this function)
bulk-checkin.c:128: error: (Each undeclared identifier is reported only once
bulk-checkin.c:128: error: for each function it appears in.)
bulk-checkin.c: In function ‘deflate_to_pack’:
bulk-checkin.c:193: error: ‘SHA_CTX’ undeclared (first use in this function)
bulk-checkin.c:193: error: expected ‘;’ before ‘ctx’
bulk-checkin.c:205: warning: implicit declaration of function ‘SHA1_Init’
bulk-checkin.c:205: error: ‘ctx’ undeclared (first use in this function)
bulk-checkin.c:222: warning: passing argument 3 of ‘stream_to_pack’ makes integer from pointer without a cast
bulk-checkin.c:95: note: expected ‘int’ but argument is of type ‘off_t *’
bulk-checkin.c:222: error: incompatible type for argument 6 of ‘stream_to_pack’
bulk-checkin.c:95: note: expected ‘const char *’ but argument is of type ‘enum object_type’
bulk-checkin.c:222: warning: passing argument 7 of ‘stream_to_pack’ makes integer from pointer without a cast
bulk-checkin.c:95: note: expected ‘unsigned int’ but argument is of type ‘const char *’
bulk-checkin.c:222: error: too many arguments to function ‘stream_to_pack’
bulk-checkin.c:237: warning: implicit declaration of function ‘SHA1_Final’
make: *** [bulk-checkin.o] Error 1
make prefix=/usr/local/git install
我得到這個
CC bulk-checkin.o
In file included from cache.h:4,
from bulk-checkin.h:7,
from bulk-checkin.c:4:
git-compat-util.h:213:25: warning: openssl/ssl.h: No such file or directory
git-compat-util.h:214:25: warning: openssl/err.h: No such file or directory
git-compat-util.h:320:25: warning: openssl/evp.h: No such file or directory
git-compat-util.h:321:26: warning: openssl/hmac.h: No such file or directory
git-compat-util.h:323:28: warning: openssl/x509v3.h: No such file or directory
In file included from bulk-checkin.h:7,
from bulk-checkin.c:4:
cache.h:11:21: warning: openssl/sha.h: No such file or directory
In file included from bulk-checkin.c:5:
csum-file.h:11: error: expected specifier-qualifier-list before ‘SHA_CTX’
csum-file.h:23: error: expected specifier-qualifier-list before ‘SHA_CTX’
bulk-checkin.c:96: error: expected declaration specifiers or ‘...’ before ‘SHA_CTX’
bulk-checkin.c: In function ‘stream_to_pack’:
bulk-checkin.c:128: warning: implicit declaration of function ‘SHA1_Update’
bulk-checkin.c:128: error: ‘ctx’ undeclared (first use in this function)
bulk-checkin.c:128: error: (Each undeclared identifier is reported only once
bulk-checkin.c:128: error: for each function it appears in.)
bulk-checkin.c: In function ‘deflate_to_pack’:
bulk-checkin.c:193: error: ‘SHA_CTX’ undeclared (first use in this function)
bulk-checkin.c:193: error: expected ‘;’ before ‘ctx’
bulk-checkin.c:205: warning: implicit declaration of function ‘SHA1_Init’
bulk-checkin.c:205: error: ‘ctx’ undeclared (first use in this function)
bulk-checkin.c:222: warning: passing argument 3 of ‘stream_to_pack’ makes integer from pointer without a cast
bulk-checkin.c:95: note: expected ‘int’ but argument is of type ‘off_t *’
bulk-checkin.c:222: error: incompatible type for argument 6 of ‘stream_to_pack’
bulk-checkin.c:95: note: expected ‘const char *’ but argument is of type ‘enum object_type’
bulk-checkin.c:222: warning: passing argument 7 of ‘stream_to_pack’ makes integer from pointer without a cast
bulk-checkin.c:95: note: expected ‘unsigned int’ but argument is of type ‘const char *’
bulk-checkin.c:222: error: too many arguments to function ‘stream_to_pack’
bulk-checkin.c:237: warning: implicit declaration of function ‘SHA1_Final’
make: *** [bulk-checkin.o] Error 1
而這兩個線
# echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/bashrc
# source /etc/bashrc
執行成功
但是當我鍵入git --version
我仍然得到
慶典:在/ usr /斌/ git的:沒有這樣的文件或目錄
你運行配置腳本?檢查'echo $ CC' – hjpotter92
@ hjpotter92當我運行'echo $ CC'或'echo $ cc'時,我得到一個空行 – Varun