Skip to content

Instantly share code, notes, and snippets.

@minhoryang
Last active June 24, 2017 19:58
Show Gist options
  • 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

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