Skip to content

Instantly share code, notes, and snippets.

@minhoryang
Last active June 24, 2017 19:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save minhoryang/ab8d3c05afb4055632b3 to your computer and use it in GitHub Desktop.
Save minhoryang/ab8d3c05afb4055632b3 to your computer and use it in GitHub Desktop.
RELEASE Tiny Lecture: INSTALL GIT BINARY WITHOUT ROOT/SUDOER @ UBUNTU
mkdir /tmp/git
pushd /tmp/git
# 1. download git
apt-get source git
pushd git-*
# 2. build and install git
./configure --prefix=$HOME/.local/`uname -m`/ # want to install git for my home directory.
make
make install # Now you can reach git at ~/.local/`uname -m`/bin/git
pushd ~/
git clone https://github.com/minhoryang/minhoryang.github.io.git
# but failed, no https supported!
popd
./configure --prefix=$HOME/.local/`uname -m`/ | tee /tmp/git_install.log
# "checking for curl_global_init in -lcurl... no"
# but we need to use curl for https
popd
apt-get source libcurl4-openssl-dev
pushd curl-*
./configure --prefix=$HOME/.local/`uname -m`/
make
make install
# success!
# ~/.local/`uname -m`/lib/libcurl.so
# ~/.local/`uname -m`/include/curl.h
popd
pushd git-*
./configure --prefix=$HOME/.local/`uname -m`/
# still not finding "libcurl"
LDFLAGS=-L$HOME/.local/`uname -m`/lib/ CPPFLAGS=-I$HOME/.local/`uname -m`/include/ ./configure --prefix=$HOME/.local/`uname -m`/ # FAILED
### IF NOT!!!!! (updated @ 20160921 by Taesung Lee)
./configure --prefix=$HOME/.local/`uname -m`/ --with-curl=$HOME/.local/`uname -m`/
### IT WILL WORKS!
make
make install
pushd ~/
$HOME/.local/`uname -m`/bin/git clone https://github.com/minhoryang/minhoryang.github.io.git
# successfully happy ending!
checkcpuforpath () {
cpuinfo=`cat /proc/cpuinfo | grep "cpu family" | grep 15`
if [ -d ~/.local/bin ]; then
export PATH=~/.local/bin:$PATH
fi
if [ -d ~/.local/lib/python2.6/site-packages ]; then
export PYTHONPATH=/usr/lib/python2.6/:~/.local/lib/python2.6/site-packages:$PYTHONPATH
fi
if [ -n "$cpuinfo" ]; then
echo "Connected with cspro(1:2).sogang.ac.kr"
if [ -d ~/.local/bin_32 ]; then
export PATH=~/.local/bin_32:$PATH
fi
export PKG_CONFIG_PATH=~/.local/lib_32/pkgconfig:/usr/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib_32
if [ -d ~/.local/lib_32/python2.6/site-packages ]; then
export PYTHONPATH=~/.local/lib_32/python2.6/site-packages:$PYTHONPATH
fi
else
echo "Connected with cspro.sogang.ac.kr"
if [ -d ~/.local/bin_64 ]; then
export PATH=~/.local/bin_64:$PATH
fi
export PKG_CONFIG_PATH=~/.local/lib_64/pkgconfig:/usr/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/lib/
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib_64
if [ -d ~/.local/lib_64/python2.6/site-packages ]; then
export PYTHONPATH=~/.local/lib_64/python2.6/site-packages:$PYTHONPATH
fi
fi
export PATH=~/bin:$PATH
}
@minhoryang
Copy link
Author

YOU SHOULD CHECK THIS OUT http://joemaller.com/908/how-to-install-git-on-a-shared-host/#comment-2513783741

cd ~/
mkdir src
cd src
wget https://github.com/git/git/arc...
wget https://curl.haxx.se/download/...
tar -xzvf v2.7.1.tar.gz 
tar -xzvf curl-7.47.1.tar.gz

cd git-2.7.1/
make configure
./configure --prefix=$HOME --with-curl=~/src/curl-7.47.1

make
make install

@taeseunglee
Copy link

몇일간의 고통이 해결되었네요 ㅠㅠㅠ 조만간 제 gist에도 정리해서 올려볼께요. 참고한 링크들 몽땅 모으고, 어떤 이슈 때문에 고통 받았는지...? 등등 ㅋㅋㅋㅋ

@minhoryang
Copy link
Author

If you want to use your home directory even with mac, try this for everywhere.

$HOME/.local/`uname`/`uname -m`

@minhoryang
Copy link
Author

@SGsupernova ㅋㅋㅋㅋㅋㅋㅋㅋㅋ 땡큐!!!!!

@juice500ml
Copy link

@SGsupernova @minhoryang
is curl necessary? what about wget?

@minhoryang
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment