Introduce git from source into Linux environment using wget with non-root privileges

At the beginning

This is a git installation method when the package management system such as brew install, apt-get, yum cannot be used due to authority (non-root authority). The shared calculator may have git pre-installed, but since it was git version 1.7.1, I tried installing git version 2.8.1. (This is not new)

Execution environment

procedure

First, create an installation directory that you have permissions on. For example, if the location you logged in with ssh is / home / YOUR_NAME,

$ mkdir /home/YOUR_NAME/local

Create your own local directory in the form of. The name and location of this directory can be anywhere under your home directory.

Install git as follows. Please change the version as appropriate.

$ wget https://www.kernel.org/pub/software/scm/git/git-2.8.1.tar.gz --no-check-certificate
$ tar zxvf git-2.8.1.tar.gz
$ cd git-2.8.1
$ ./configure --prefix=/home/YOUR_NAME/local NO_OPENSSL=1 NO_CURL=1
$ make ; make install

Finally, add a PATH so that the old git pre-installed on the server isn't used when you type git. (Write in .bashrc)

~/.bashrc


export PATH=/home/YOUR_NAME/local/bin:$PATH
$ source ~/.bashrc

that's all.

reference

Recommended Posts

Introduce git from source into Linux environment using wget with non-root privileges
Try installing Git from source using Ansible's make and unarchive modules