1
0

More than 3 years have passed since last update.

非root権限でwgetを用いてソースからgitをLinux環境に導入する

Posted at

始めに

brew install, apt-get, yum 等のパッケージ管理システムが権限の都合(非root権限)で使えない場合のgit導入方法です。共有計算機には予めgitが入っていることもありますが、git version 1.7.1だったのでgit version 2.8.1を入れてみました。(これでも新しくはない)

実行環境

  • Red Hat Enterprise Linux Server release 6.3 (Santiago)

手順

先に、自分の権限が及ぶインストール先のディレクトリを作っておきます。例えばsshでログインした場所が/home/YOUR_NAMEである場合、

$ mkdir /home/YOUR_NAME/local

といった形で自分専用のlocalディレクトリを作っておきます。このディレクトリの名前や場所は、自分のホームディレクトリ以下であればどこでも良いです。

gitのインストールは以下の通り進めます。バージョンは適宜変更して下さい。

$ 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

最後に、gitとコマンドを打った時にサーバーに予めインストールされている古いgitが使われないように、PATHを書き足します。(.bashrcに書く)

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

以上です。

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0