Consider two common user: A & B, neither has sudo privilage.
/home/A A A rwx------
/home/B B B rwx------
A wanted to build git from source code:
cd /home/A/third-src
wget & extract git.source
./configure --prefix=/home/A/third/git
make install # install without root
export PATH & LD_LIBRARY_PATH
# Here A can use git correctly
Now B wanted to reuse A's git, so B asked root to
cp -r /home/A/third/git /home/B/third/git
chown -R B:B /home/B/third/git
B exported PATH & LD_LIBRARY_PATH for B's git, and expected to use git correctly, but it does not work!! git complains no permission to read file in /home/A/third/git:
git init
fatal: unable to access '/home/A/third/git/etc/gitconfig': Permission denied
It seems --prefix put absolute path into executable files.
strings bin/git # it really lists /home/A/third/git
How to fix it? Is there a canonical way to share locally installed program to others without using root?
Thank you in advance.