0

Continuing from Compiler error - msgfmt command not found when compiling git on a shared hosting

How do I, after managing to make and install the latest git, force the cpanel shared host to use my version?

  • My version is under /home/<ME>/git/git-2.9.0

  • I compiled the make script with

    make -i prefix=/home/<ME>/bin all
    
  • echo $PATH; lists that path in the variable. Also, the path is appended to the current PATH.

Now, I want the server to respond with

/home/<ME>/bin/git

when I run which git

Community
  • 1
  • 1
Schrodinger's cat
  • 1,074
  • 10
  • 17
  • Run `echo $PATH` and tell us what it says. – John Zwinck Apr 23 '17 at 09:05
  • @JohnZwinck - Like I said, the path seems to be appended alright---the output of echoing the path variable is `home//perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/cpanel/composer/bin:/opt/puppetlabs/bin:/opt/dell/srvadmin/bin:/home//bin` – Schrodinger's cat Apr 23 '17 at 09:14
  • Is the PATH lookup recursive? - Does the host lookup for a binary in any/all nested sub directories? – Schrodinger's cat Apr 23 '17 at 09:17
  • It is not recursive. But the more important thing is that you've put your preferred path at the END when it should be at the START of the $PATH variable. As it stands, your system will only look in your directory as a last resort, after all the other ones where it might find `git`. – John Zwinck Apr 23 '17 at 10:18

1 Answers1

0

SO,Post Installation, the binaries were stored in

/home/<ME>/bin/bin/

because, I compiled with

make -i prefix=/home/<ME>/bin all

Issue

PATH lookups are not recursive.

SOLUTION

  • Optionally, Move all git binaries into a sub directory under /home/<me>/bin/

  • Just add all subdirectories of /home/<ME>/bin/

to the current PATH. inside .~/.bash_profile

and do

source ~/.bash_profile

Community
  • 1
  • 1
Schrodinger's cat
  • 1,074
  • 10
  • 17