2015-09-22 3 views
0

Я пытаюсь установить git в Redhat6. Я следую how to install git этот учебник.Как установить последнюю версию git в Redhat 6.x/7.x

# 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 

Я могу клонировать репо и в состоянии загрузить файл zip 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 

Как решить эту проблему?

Я могу установить git с помощью yum install git. но по умолчанию 1.7.1 получает установку. Но я хочу установить выше 2.

Edit 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/BIN/мерзавца: Нет такого файл или справочник

+0

ли вы запустить конфигурационный скрипт? Проверить 'echo $ CC' – hjpotter92

+0

@ hjpotter92 Когда я запускаю' echo $ CC' или 'echo $ cc', я получаю пустую строку – Varun

ответ

3

Похоже, /bin/sh: cc: command not found - это сообщение об ошибке, и оно было разделено на 2 строки, чтобы добавить дополнительную путаницу. т.е. нет команды cc.

Это означает, что вам необходимо установить компилятор C. Если вы выполните следующую команду, он должен установить все необходимые инструменты (gcc, binutils и т. Д.) Для компиляции git.

yum groupinstall 'Development Tools'

Вы также отсутствуют необходимые заголовки развития, как OpenSSL:

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

, можете ли вы проверить приведенную выше ошибку и любое решение для этого. can not Я загружаю папку git и устанавливаю домашний путь в .bash_profile. – Varun

1

Вы найдете ниже шаги, которые я последовал установить Git без доступа в Интернет по системе

Download the desired tarball from below link, on your PC/Laptop https://www.kernel.org/pub/software/scm/git/ 

Я использовал Git-2.8, так как требование клиента состояло в том, чтобы иметь версию> = Git-2.74

Connect to remote Linux system (via winscp or nay other remote connectivity tool). And Place/Move the downloaded git-XXXXXX.tar.gz file on desired location on the linux system where you want to install ‘git’. 
I placed it in Directory: /var/opt/teradata/packages/Package/GIT/ 

From command prompt go to the directory where you placed the above file and run below command to untar the package tar -xvzf git-2.8.0.tar.gz 

CD into the directory that is newly created because of untar command above. cd git-2.8.0/ 

Verify that all the needed files and directories have been uncompressed into the above folder ls -ltr 

Set the Path and Prefix variables with commands below. 

PATH = $ PATH: /var/opt/teradata/packages/Package/GIT/git-2.8.0/usr/bin

PATH = $ PATH:/вар/Opt/Teradata/пакеты /Package/GIT/git-2.8.0

экспорт PATH = $ PATH: /var/opt/teradata/packages/Package/GIT/git-2.8.0

делают префикс =/USR/местные/git все

echo $ CC

Run Below command to check the preinstall configuration checks ./configure 

Run Below command to install. 

сделать установку

Now see it work with below command 

GIT --version

Смежные вопросы