编译安装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 docbook2x Loaded plugins: axelget, langpacks No metadata available for base No metadata available for dockerrepo No metadata available for elrepo No metadata available for epel No metadata available for extras No metadata available for mariadb No metadata available for nginx No metadata available for remi No metadata available for remi-php70 No metadata available for remi-php70-test No metadata available for remi-safe No metadata available for remi-test No metadata available for rpmforge No metadata available for rpmforge-extras No metadata available for rpmforge-testing No metadata available for salt-2015.8 No metadata available for updates No 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 --version git version 2.8.0
按照这个步骤安装成功,命令差别在于编译的时候:
成功
# make prefix=/usr/local/git all
有错误
$ make configure $ ./configure --prefix=/usr $ make all doc info
问题:
这两组命令的区别是什么?
The main difference is that the first command does not generate git help documents (man/info and the like), but the second command does, so it actually works when
`
make all跟
make all doc info之间的的区别),prefix只是指定一个目录前缀,在安装(
make install`
) and does not have much impact on the compilation process. These are explained in the INSTALL document.