I to install the latest available git today (git-2.17.1), on CentOS 7.4, because some applications are complaining for it, and not only.

I'm trying to install git-2.17.1 from source on CentOS 7.4.

These are the procedures I tried:

  • Uninstalled the old git (only) using:

    a) rpm -e --nodeps git

  • Downloaded and extracted the file git-2.17.1.zip on /home/myusername/temp/

  • Changed to the extracted file's directory, in this case /home/myusername/temp/git-2.17.1/

  • As a super user, installed all supposedly needed dependencies, using:

    a) yum install docbook2X-0.8.8-17.el7.x86_64.rpm (after having downloaded this package)

    b) yum dh-autoreconf curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel asciidoc xmlto gengetopt autoconf libcurl-devel gcc kernel-headers debhelper intltool perl-Git po-debconf

  • Created a symlink as instructed on scm-git web site, using:

    a) ln -s /usr/bin/db2x_docbook2texi /usr/bin/docbook2x-texi

  • As a normal user, ran the following:

  • ./configure CFLAGS='-I/usr/local/openssl/include' LDFLAGS='-L/usr/local/openssl/lib' --prefix=/usr/local/git --with-openssl=/usr/local/bin/openssl

  • make all doc info

  • And again, as a super user, ran the following:

  • make install install-doc install-html install-info

The problem arises on last step, outputting the following:

install -m 644 git.info gitman.info /usr/local/git/share/info
if test -r /usr/local/git/share/info/dir; then \
  install-info --info-dir=/usr/local/git/share/info git.info ;\
  install-info --info-dir=/usr/local/git/share/info gitman.info ;\
else \
  echo "No directory found in /usr/local/git/share/info" >&2 ; \
No directory found in /usr/local/git/share/info
e[1]: Leaving directory `/home/myusername/temp/git-2.17.1/Documentation'

I successfully upgraded openssl version to the latest available today (openssl 1.1.0h).


That's not error, you can check it with echo $? after running make install-info. Target install-info in Documentation/Makefile looks like this:

install-info: info
    $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
    $(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
    if test -r $(DESTDIR)$(infodir)/dir; then \
      $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
      $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
    else \
      echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \

Program named install correctly creates info-pages in /usr/local/git/share/info/, you can check it:

$ ls -lh /usr/local/git/share/info/
total 2.3M
-rw-r--r-- 1 root root 218K Jun 13 21:46 git.info
-rw-r--r-- 1 root root 2.1M Jun 13 21:46 gitman.info

The install-info target was introduced in commit 4739809c and says:

If the info target directory does not already contain a "dir" file, no directory entry is created.

A file named dir is a part of GNU texinfo but it's not required.

Also notice that unless you have /usr/local/git/bin/ in your $PATH you cannot start git by simply typing git after installing it the way you did, you have to do this instead:

$ /usr/local/git/bin/git --version
git version 2.17.1
  • It worked I just needed to properly set the $PATH, as you said. – El_Dorado Jun 14 '18 at 10:38

How to correctly install Git 2.17.1 from source on CentOS 7

Probably build the "2.17.1" packages, and install the required packages with yum.

Source package ftp://ftp.icm.edu.pl/vol/rzm6/linux-fedora/linux/updates/28/Everything/SRPMS/Packages/g/git-2.17.1-2.fc28.src.rpm

Setup $HOME/rpms/ https://www.linuxquestions.org/questions/linux-software-2/need-rpm-package-for-php-version-5-2-7-and-up-on-redhat-5-1-a-766486/#13

$ rpm -i git-2.17.1-2.fc28.src.rpm

# yum install libcurl-devel libsecret-devel pcre2-devel tk cvs cvsps \ 
httpd mod_dav_svn subversion subversion-perl perl-DBD-SQLite perl-CPAN

# cpan
cpan[1]> install IO::Pty
cpan[2]> install Test::More

$ cd rpms/SPECS/
$ rpmbuild -bb git.spec
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-2.17.1-2.el7.x86_64.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-all-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-core-2.17.1-2.el7.x86_64.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-core-doc-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-cvs-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-daemon-2.17.1-2.el7.x86_64.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-email-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/gitk-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/gitweb-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-gui-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/git-p4-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/perl-Git-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/noarch/perl-Git-SVN-2.17.1-2.el7.noarch.rpm
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-subtree-2.17.1-2.el7.x86_64.rpm
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-svn-2.17.1-2.el7.x86_64.rpm
Wrote: /home/knudfl/rpms/RPMS/x86_64/git-debuginfo-2.17.1-2.el7.x86_64.rpm

The 16 packages https://drive.google.com/drive/folders/1PRxoicjzHWunFZW-hhXT9JsFk_PQIoLs?usp=sharing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.