【原创】CentOS6.4 下源码安装 git

本文详细记录了在CentOS 6.4系统中从源码安装Git 1.9.2版本的过程。针对安装过程中遇到的各种问题,如缺少依赖库、编译错误等,提供了具体的解决办法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


查看系统版本信息
[root@Betty ~]# cat /etc/redhat-release 
CentOS release 6.4 (Final)
在系统没有配置额外 yum 源的情况下,通过 yum 能安装的最新 git 版本为 git-1.7.1-3.el6_4.1.x86_64 。因为我打算源码安装最新版本,所以
[root@Betty ~]# yum erase git
[root@Betty ~]# cd workspace/WGET/
[root@Betty WGET]# wget https://codeload.github.com/git/git/tar.gz/v1.9.2
[root@Betty WGET]# mv v1.9.2 git-1.9.2.tar.gz
[root@Betty WGET]# tar zxvf git-1.9.2.tar.gz 
[root@Betty WGET]# cd git-1.9.2
[root@Betty git-1.9.2]#
查看安装相关信息。
[root@Betty git-1.9.2]# vi INSTALL 

                Git installation

Normally you can just do "make" followed by "make install", and that
will install the git programs in your own ~/bin/ directory.  If you want
to do a global install, you can do

        $ make prefix=/usr all doc info ;# as yourself
        # make prefix=/usr install install-doc install-html install-info ;# as root

(or prefix=/usr/local, of course).  Just like any program suite
that uses $prefix, the built results have some paths encoded,
which are derived from $prefix, so "make all; make prefix=/usr
install" would not work.
...
 - Git is reasonably self-sufficient, but does depend on a few external
   programs and libraries.  Git can be used without most of them by adding
   the approriate "NO_<LIBRARY>=YesPlease" to the make command line or
   config.mak file.

        - "zlib", the compression library. Git won't build without it.

        - "ssh" is used to push and pull over the net.

        - A POSIX-compliant shell is required to run many scripts needed
          for everyday use (e.g. "bisect", "pull").

        - "Perl" version 5.8 or later is needed to use some of the
          features (e.g. preparing a partial commit using "git add -i/-p",
          interacting with svn repositories with "git svn").  If you can
          live without these, use NO_PERL.  Note that recent releases of
          Redhat/Fedora are reported to ship Perl binary package with some
          core modules stripped away (see http://lwn.net/Articles/477234/),
          so you might need to install additional packages other than Perl
          itself, e.g. Time::HiRes.

        - "openssl" library is used by git-imap-send to use IMAP over SSL.
          If you don't need it, use NO_OPENSSL.

          By default, git uses OpenSSL for SHA1 but it will use its own
          library (inspired by Mozilla's) with either NO_OPENSSL or
          BLK_SHA1.  Also included is a version optimized for PowerPC
          (PPC_SHA1).

        - "libcurl" library is used by git-http-fetch and git-fetch.  You
          might also want the "curl" executable for debugging purposes.
          If you do not use http:// or https:// repositories, you do not
          have to have them (use NO_CURL).

        - "expat" library; git-http-push uses it for remote lock
          management over DAV.  Similar to "curl" above, this is optional
          (with NO_EXPAT).

        - "wish", the Tcl/Tk windowing shell is used in gitk to show the
          history graphically, and in git-gui.  If you don't want gitk or
          git-gui, you can use NO_TCLTK.

        - A gettext library is used by default for localizing Git. The
          primary target is GNU libintl, but the Solaris gettext
          implementation also works.

          We need a gettext.h on the system for C code, gettext.sh (or
          Solaris gettext(1)) for shell scripts, and libintl-perl for Perl
          programs.

          Set NO_GETTEXT to disable localization support and make Git only
          use English. Under autoconf the configure script will do this
          automatically if it can't find libintl on the system.

        - Python version 2.4 or later (but not 3.x, which is not
          supported by Perforce) is needed to use the git-p4 interface
          to Perforce.
按照 INSTALL 里的说明,执行
[root@Betty git-1.9.2]# make prefix=/usr all doc info
...
In file included from http.c:1:
http.h:54: 错误:expected specifier-qualifier-list before ‘CURLcode’
http.h:60: 错误:expected specifier-qualifier-list before ‘CURL’
http.h:107: 错误:‘CURL_ERROR_SIZE’未声明(不在函数内)
http.h: 在函数‘missing__target’中:
http.h:112: 错误:‘CURLE_FILE_COULDNT_READ_FILE’未声明(在此函数内第一次使用)
http.h:112: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
http.h:112: 错误:所在的函数内也只报告一次。)
http.h:114: 错误:‘CURLE_HTTP_NOT_FOUND’未声明(在此函数内第一次使用)
http.h:116: 错误:‘CURLE_FTP_COULDNT_RETR_FILE’未声明(在此函数内第一次使用)
http.h: 在文件层:
http.h:193: 错误:expected specifier-qualifier-list before ‘CURLcode’
http.c:223: 错误:expected ‘)’ before ‘*’ token
http.c:293: 错误:expected ‘)’ before ‘*’ token
http.c:299: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
http.c: 在函数‘http_init’中:
http.c:409: 警告:隐式声明函数‘curl_slist_append’
http.c:409: 警告:赋值时将整数赋给指针,未作类型转换
http.c:410: 警告:赋值时将整数赋给指针,未作类型转换
http.c: 在函数‘http_cleanup’中:
http.c:477: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:478: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:482: 警告:隐式声明函数‘curl_easy_cleanup’
http.c:482: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:498: 警告:隐式声明函数‘curl_slist_free_all’
http.c: 在函数‘get_active_slot’中:
http.c:533: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c:534: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:538: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:539: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c:540: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:546: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:547: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:548: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c:553: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:555: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:555: 警告:隐式声明函数‘get_curl_handle’
http.c:563: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c:564: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:565: 错误:‘struct active_request_slot’没有名为‘finished’的成员
http.c:566: 错误:‘struct active_request_slot’没有名为‘callback_data’的成员
http.c:567: 错误:‘struct active_request_slot’没有名为‘callback_func’的成员
http.c:568: 警告:隐式声明函数‘curl_easy_setopt’
http.c:568: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:568: 错误:‘CURLOPT_COOKIEFILE’未声明(在此函数内第一次使用)
http.c:570: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:570: 错误:‘CURLOPT_COOKIEJAR’未声明(在此函数内第一次使用)
http.c:571: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:571: 错误:‘CURLOPT_HTTPHEADER’未声明(在此函数内第一次使用)
http.c:572: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:572: 错误:‘CURLOPT_ERRORBUFFER’未声明(在此函数内第一次使用)
http.c:573: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:573: 错误:‘CURLOPT_CUSTOMREQUEST’未声明(在此函数内第一次使用)
http.c:574: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:574: 错误:‘CURLOPT_READFUNCTION’未声明(在此函数内第一次使用)
http.c:575: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:575: 错误:‘CURLOPT_WRITEFUNCTION’未声明(在此函数内第一次使用)
http.c:576: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:576: 错误:‘CURLOPT_POSTFIELDS’未声明(在此函数内第一次使用)
http.c:577: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:577: 错误:‘CURLOPT_UPLOAD’未声明(在此函数内第一次使用)
http.c:578: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:578: 错误:‘CURLOPT_HTTPGET’未声明(在此函数内第一次使用)
http.c:579: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:579: 错误:‘CURLOPT_FAILONERROR’未声明(在此函数内第一次使用)
http.c:581: 警告:隐式声明函数‘init_curl_http_auth’
http.c:581: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c: 在函数‘run_active_slot’中:
http.c:723: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c:724: 错误:‘struct active_request_slot’没有名为‘curl_result’的成员
http.c:724: 警告:隐式声明函数‘curl_easy_perform’
http.c:724: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c: 在函数‘closedown_active_slot’中:
http.c:733: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c: 在函数‘release_active_slot’中:
http.c:739: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:743: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:744: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c: 在函数‘finish_active_slot’中:
http.c:755: 警告:隐式声明函数‘curl_easy_getinfo’
http.c:755: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:755: 错误:‘CURLINFO_HTTP_CODE’未声明(在此函数内第一次使用)
http.c:755: 错误:‘struct active_request_slot’没有名为‘http_code’的成员
http.c:757: 错误:‘struct active_request_slot’没有名为‘finished’的成员
http.c:758: 错误:‘struct active_request_slot’没有名为‘finished’的成员
http.c:761: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:762: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:762: 错误:‘struct active_request_slot’没有名为‘curl_result’的成员
http.c:763: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:763: 错误:‘struct active_request_slot’没有名为‘http_code’的成员
http.c:768: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:773: 错误:‘struct active_request_slot’没有名为‘callback_func’的成员
http.c:774: 错误:‘struct active_request_slot’没有名为‘callback_func’的成员
http.c:774: 错误:‘struct active_request_slot’没有名为‘callback_data’的成员
http.c: 在函数‘finish_all_active_slots’中:
http.c:782: 错误:‘struct active_request_slot’没有名为‘in_use’的成员
http.c:786: 错误:‘struct active_request_slot’没有名为‘next’的成员
http.c: 在函数‘handle_curl_result’中:
http.c:846: 错误:‘struct slot_results’没有名为‘curl_result’的成员
http.c:846: 错误:‘CURLE_OK’未声明(在此函数内第一次使用)
http.c:847: 错误:‘struct slot_results’没有名为‘http_code’的成员
http.c:848: 错误:‘struct slot_results’没有名为‘curl_result’的成员
http.c:848: 错误:‘CURLE_HTTP_NOT_FOUND’未声明(在此函数内第一次使用)
http.c:857: 错误:‘struct slot_results’没有名为‘http_code’的成员
http.c:860: 错误:‘struct slot_results’没有名为‘curl_result’的成员
http.c:863: 错误:‘struct slot_results’没有名为‘http_code’的成员
http.c:863: 错误:‘struct slot_results’没有名为‘curl_result’的成员
http.c:865: 错误:‘struct slot_results’没有名为‘http_code’的成员
http.c: 在文件层:
http.c:883: 错误:expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘curlinfo_strbuf’
http.c: 在函数‘http_request’中:
http.c:910: 错误:‘struct active_request_slot’没有名为‘results’的成员
http.c:911: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:911: 错误:‘CURLOPT_HTTPGET’未声明(在此函数内第一次使用)
http.c:914: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:914: 错误:‘CURLOPT_NOBODY’未声明(在此函数内第一次使用)
http.c:916: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:917: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:917: 错误:‘CURLOPT_FILE’未声明(在此函数内第一次使用)
http.c:921: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:921: 错误:‘CURLOPT_WRITEFUNCTION’未声明(在此函数内第一次使用)
http.c:925: 警告:赋值时将整数赋给指针,未作类型转换
http.c:929: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:937: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:937: 错误:‘CURLOPT_FAILONERROR’未声明(在此函数内第一次使用)
http.c:939: 警告:赋值时将整数赋给指针,未作类型转换
http.c:941: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:941: 错误:‘CURLOPT_URL’未声明(在此函数内第一次使用)
http.c:942: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:942: 错误:‘CURLOPT_HTTPHEADER’未声明(在此函数内第一次使用)
http.c:943: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:943: 错误:‘CURLOPT_ENCODING’未声明(在此函数内第一次使用)
http.c:955: 警告:隐式声明函数‘curlinfo_strbuf’
http.c:955: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:955: 错误:‘CURLINFO_CONTENT_TYPE’未声明(在此函数内第一次使用)
http.c:959: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:959: 错误:‘CURLINFO_EFFECTIVE_URL’未声明(在此函数内第一次使用)
http.c: 在函数‘new_http_pack_request’中:
http.c:1324: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:1324: 错误:‘CURLOPT_FILE’未声明(在此函数内第一次使用)
http.c:1325: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:1325: 错误:‘CURLOPT_WRITEFUNCTION’未声明(在此函数内第一次使用)
http.c:1326: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:1326: 错误:‘CURLOPT_URL’未声明(在此函数内第一次使用)
http.c:1327: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c:1327: 错误:‘CURLOPT_HTTPHEADER’未声明(在此函数内第一次使用)
http.c:1341: 警告:赋值时将整数赋给指针,未作类型转换
http.c:1342: 错误:‘struct active_request_slot’没有名为‘curl’的成员
http.c: 在函数‘fwrite_sha1_file’中:
http.c:1371: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1372: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1374: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1375: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1376: 错误:‘struct http_object_request’没有名为‘zret’的成员
http.c:1376: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1377: 错误:‘struct http_object_request’没有名为‘c’的成员
http.c:1378: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1379: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1379: 错误:‘struct http_object_request’没有名为‘zret’的成员
http.c: 在函数‘new_http_object_request’中:
http.c:1398: 错误:‘struct http_object_request’没有名为‘sha1’的成员
http.c:1435: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1437: 错误:‘struct http_object_request’没有名为‘c’的成员
http.c:1469: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1469: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1470: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1471: 错误:‘struct http_object_request’没有名为‘c’的成员
http.c:1483: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1485: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1485: 错误:‘CURLOPT_FILE’未声明(在此函数内第一次使用)
http.c:1486: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1486: 错误:‘CURLOPT_WRITEFUNCTION’未声明(在此函数内第一次使用)
http.c:1487: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1487: 错误:‘CURLOPT_ERRORBUFFER’未声明(在此函数内第一次使用)
http.c:1487: 错误:‘struct http_object_request’没有名为‘errorstr’的成员
http.c:1488: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1488: 错误:‘CURLOPT_URL’未声明(在此函数内第一次使用)
http.c:1489: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1489: 错误:‘CURLOPT_HTTPHEADER’未声明(在此函数内第一次使用)
http.c:1501: 警告:赋值时将整数赋给指针,未作类型转换
http.c:1502: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c: 在函数‘process_http_object_request’中:
http.c:1516: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1518: 错误:‘struct http_object_request’没有名为‘curl_result’的成员
http.c:1518: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1519: 错误:‘struct http_object_request’没有名为‘http_code’的成员
http.c:1519: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1520: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c: 在函数‘finish_http_object_request’中:
http.c:1532: 错误:‘struct http_object_request’没有名为‘http_code’的成员
http.c:1534: 错误:‘struct http_object_request’没有名为‘curl_result’的成员
http.c:1534: 错误:‘CURLE_OK’未声明(在此函数内第一次使用)
http.c:1541: 错误:‘struct http_object_request’没有名为‘stream’的成员
http.c:1542: 错误:‘struct http_object_request’没有名为‘real_sha1’的成员
http.c:1542: 错误:‘struct http_object_request’没有名为‘c’的成员
http.c:1543: 错误:‘struct http_object_request’没有名为‘zret’的成员
http.c:1547: 错误:‘struct http_object_request’没有名为‘sha1’的成员
http.c:1547: 错误:‘struct http_object_request’没有名为‘real_sha1’的成员
http.c:1551: 错误:‘struct http_object_request’没有名为‘rename’的成员
http.c:1552: 错误:‘struct http_object_request’没有名为‘sha1’的成员
http.c:1554: 错误:‘struct http_object_request’没有名为‘rename’的成员
http.c: 在函数‘release_http_object_request’中:
http.c:1574: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1575: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1576: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1577: 错误:‘struct http_object_request’没有名为‘slot’的成员
http.c:1578: 错误:‘struct http_object_request’没有名为‘slot’的成员
make: *** [http.o] 错误 1
[root@Betty git-1.9.2]#
更新 libcurl 版本,并安装相应的 libcurl-devel 开发包。
[root@Betty ~]# yum update curl libcurl
[root@Betty ~]# yum -y install libcurl-devel.x86_64
重新执行 make 命令。
[root@Betty git-1.9.2]# make prefix=/usr all doc info
    CC http.o
    CC http-walker.o
    CC http-fetch.o
    LINK git-http-fetch
    CC http-push.o
http-push.c:17:19: 警告:expat.h:没有那个文件或目录
http-push.c:839: 警告:在‘XML_Char’的声明中,类型默认为‘int’
http-push.c:839: 错误:expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
http-push.c: 在函数‘lock_remote’中:
http-push.c:910: 错误:‘XML_Parser’未声明(在此函数内第一次使用)
http-push.c:910: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
http-push.c:910: 错误:所在的函数内也只报告一次。)
http-push.c:910: 错误:expected ‘;’ before ‘parser’
http-push.c:917: 警告:隐式声明函数‘XML_SetUserData’
http-push.c:917: 错误:‘parser’未声明(在此函数内第一次使用)
http-push.c:918: 警告:隐式声明函数‘XML_SetElementHandler’
http-push.c:920: 警告:隐式声明函数‘XML_SetCharacterDataHandler’
http-push.c:920: 错误:‘xml_cdata’未声明(在此函数内第一次使用)
http-push.c:921: 警告:隐式声明函数‘XML_Parse’
http-push.c:926: 警告:隐式声明函数‘XML_ErrorString’
http-push.c:927: 警告:隐式声明函数‘XML_GetErrorCode’
http-push.c:930: 警告:隐式声明函数‘XML_ParserFree’
http-push.c: 在函数‘remote_ls’中:
http-push.c:1154: 错误:‘XML_Parser’未声明(在此函数内第一次使用)
http-push.c:1154: 错误:expected ‘;’ before ‘parser’
http-push.c:1161: 错误:‘parser’未声明(在此函数内第一次使用)
http-push.c:1164: 错误:‘xml_cdata’未声明(在此函数内第一次使用)
http-push.c: 在函数‘locking_available’中:
http-push.c:1228: 错误:‘XML_Parser’未声明(在此函数内第一次使用)
http-push.c:1228: 错误:expected ‘;’ before ‘parser’
http-push.c:1235: 错误:‘parser’未声明(在此函数内第一次使用)
make: *** [http-push.o] 错误 1
安装 expat-devel 开发包。
[root@Betty ~]# yum -y install expat-devel.x86_64
重新执行 make 命令。
[root@Betty git-1.9.2]# make prefix=/usr all doc info
...
make -C Documentation all
make[1]: Entering directory `/root/workspace/WGET/git-1.9.2/Documentation'
    GEN mergetools-list.made
    GEN cmd-list.made
    GEN doc.dep
make[2]: Entering directory `/root/workspace/WGET/git-1.9.2'
make[2]: “GIT-VERSION-FILE”是最新的。
make[2]: Leaving directory `/root/workspace/WGET/git-1.9.2'
make[1]: Leaving directory `/root/workspace/WGET/git-1.9.2/Documentation'
make[1]: Entering directory `/root/workspace/WGET/git-1.9.2/Documentation'
make[2]: Entering directory `/root/workspace/WGET/git-1.9.2'
make[2]: “GIT-VERSION-FILE”是最新的。
make[2]: Leaving directory `/root/workspace/WGET/git-1.9.2'
    ASCIIDOC git-add.html
/bin/sh: line 1: asciidoc: command not found
make[1]: *** [git-add.html] 错误 127
make[1]: Leaving directory `/root/workspace/WGET/git-1.9.2/Documentation'
make: *** [doc] 错误 2
安装 asciidoc 。
[root@Betty ~]# yum -y install asciidoc
重新执行 make 命令。
[root@Betty git-1.9.2]# make prefix=/usr all doc info
...
make -C Documentation info
make[1]: Entering directory `/root/workspace/WGET/git-1.9.2/Documentation'
    GEN doc.dep
make[2]: Entering directory `/root/workspace/WGET/git-1.9.2'
make[2]: “GIT-VERSION-FILE”是最新的。
make[2]: Leaving directory `/root/workspace/WGET/git-1.9.2'
make[1]: Leaving directory `/root/workspace/WGET/git-1.9.2/Documentation'
make[1]: Entering directory `/root/workspace/WGET/git-1.9.2/Documentation'
make[2]: Entering directory `/root/workspace/WGET/git-1.9.2'
make[2]: “GIT-VERSION-FILE”是最新的。
make[2]: Leaving directory `/root/workspace/WGET/git-1.9.2'
    DB2TEXI user-manual.texi
/bin/sh: line 1: docbook2x-texi: command not found
make[1]: *** [user-manual.texi] 错误 127
make[1]: Leaving directory `/root/workspace/WGET/git-1.9.2/Documentation'
make: *** [info] 错误 2
[root@Betty git-1.9.2]#
执行如下命令,发现 yum 中无法找到相应的安装包。
[root@Betty ~]# yum list|grep docbook2x-texi
[root@Betty ~]# yum list|grep docbook2x
网上查找 相关信息 ,发现可以按如下方式安装 docbook2X 软件包。
[root@Betty ~]# rpm -ivh http://mirror.1000mbps.com/Fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
Retrieving http://mirror.1000mbps.com/Fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
curl: (22) The requested URL returned error: 404 Not Found
error: skipping http://mirror.1000mbps.com/Fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm - transfer failed
[root@Betty ~]#
可以看到按照上述地址获取软件包,会收到 404 NOT_FOUND。 通过 在相应的网址上查找,发现真确的命令为
[root@Betty ~]# rpm -ivh http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
Retrieving http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.8pDjJf: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
error: Failed dependencies:
        /usr/bin/sgml2xml is needed by docbook2X-0.8.8-1.el6.x86_64
        openjade is needed by docbook2X-0.8.8-1.el6.x86_64
        perl(XML::SAX::ParserFactory) is needed by docbook2X-0.8.8-1.el6.x86_64
        texinfo is needed by docbook2X-0.8.8-1.el6.x86_64
[root@Betty ~]#
此时发现还有其他依赖的包需要安装。
[root@Betty ~]# yum list|grep sgml2xml(发现这个包在 yum 源中没有,故暂不安装)
[root@Betty ~]# yum -y install openjade
[root@Betty ~]# yum -y install texinfo
[root@Betty ~]# yum -y install perl
[root@Betty ~]# yum -y install perl-XML-SAX.noarch(发现这个包不安装的话,仍旧会报上面的错误)
重新安装 docbook2X-0.8.8-1.el6.x86_64.rpm 成功。
[root@Betty ~]# rpm -ivh http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
Retrieving http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/docbook2X-0.8.8-1.el6.x86_64.rpm
warning: /var/tmp/rpm-tmp.tEcr2M: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:docbook2X              ########################################### [100%]
[root@Betty ~]#
此时还需要执行
[root@Betty ~]# find / -name db2x_docbook2texi
/usr/bin/db2x_docbook2texi
[root@Betty ~]# cd /usr/bin/
[root@Betty bin]# ln -s db2x_docbook2texi docbook2x-texi
[root@Betty bin]#
再次执行 make 命令
[root@Betty git-1.9.2]# make prefix=/usr all doc info
成功。

最后执行 install 就可以了。
[root@Betty git-1.9.2]# make prefix=/usr install install-doc install-html install-info
查看此时 git 的版本。
[root@Betty ~]# git --version
git version 1.9.2

附:安装 git 命令补齐功能(未尝试)
rpm –ivh http://mirror.1000mbps.com/fedora-epel/6Server/x86_64/bash-completion-1.3-7.el6.noarch.rpm
cp  contrib/completion/git-completion.bash /etc/bash_completion.d/
source /etc/bash_completion




转载于:https://my.oschina.net/moooofly/blog/228875

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值