问题描述
编译安装git 2.8.0,按照官方文档说的步骤,安装出错,安装步骤如下:第一步:
$ sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel
第二步:
$ sudo yum install asciidoc xmlto docbook2x
第三步:
$ tar -zxf git-2.8.0.tar.gz $ cd git-2.8.0 $ make configure $ ./configure --prefix=/usr $ make all doc info $ sudo make install install-doc install-html install-info
问题出在执行到make all doc info的时候,错误信息如下:
反正问题跟docbook2x有关,又单独安装docbook2x显示已经安装:
[root@i001 git-2.8.0]# yum install docbook2xLoaded plugins: axelget, langpacksNo metadata available for baseNo metadata available for dockerrepoNo metadata available for elrepoNo metadata available for epelNo metadata available for extrasNo metadata available for mariadbNo metadata available for nginxNo metadata available for remiNo metadata available for remi-php70No metadata available for remi-php70-testNo metadata available for remi-safeNo metadata available for remi-testNo metadata available for rpmforgeNo metadata available for rpmforge-extrasNo metadata available for rpmforge-testingNo metadata available for salt-2015.8No metadata available for updatesNo package docbook2x available.Error: Nothing to do
试了3次,都是显示一样的错误信息。然后在stackoverflow上找到一个步骤,如下:第一步:
# yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel# yum install gcc perl-ExtUtils-MakeMaker
第二步:
# yum remove git
第三步:
# cd /usr/src# wget https://www.kernel.org/pub/software/scm/git/git-2.8.0.tar.gz# tar xzf git-2.8.0.tar.gz
第四步:
# cd git-2.8.0# 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 --versiongit version 2.8.0
按照这个步骤安装成功,命令差别在于编译的时候:成功
# make prefix=/usr/local/git all
有错误
$ make configure$ ./configure --prefix=/usr$ make all doc info
问题: 这两组命令的区别是什么?
问题解答
回答1:主要区别是第一个命令不生成git的帮助文档(man/info之类的),而第二个会生成,所以其实是`make all跟make all doc info之间的的区别),prefix只是指定一个目录前缀,在安装(make install`)时起作用,对编译过程没太大影响。这些在INSTALL文档里都有说明的。