スポンサーリンク

gitを導入してみるぞい!

クラウド上に用意したcentos7にgitを入れてみます

 

こちらの記事を参考にさせていただきました

 

gitのソースをダウンロード

yumを使ってgitをインストールできれば一番楽なのですが

古いバージョンを持ってきてしまうらしいのでソースからインストールします

[root@dev381 src]# pwd
/usr/local/src
[root@dev381 src]# wget https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz
–2017-06-09 19:46:58– https://www.kernel.org/pub/software/scm/git/git-2.9.0.tar.gz
Resolving www.kernel.org (www.kernel.org)… 147.75.110.187, 2604:1380:3000:3500::3
Connecting to www.kernel.org (www.kernel.org)|147.75.110.187|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: 5903371 (5.6M) [application/x-gzip]
Saving to: ‘git-2.9.0.tar.gz’

100%[=====================================================================>] 5,903,371 22.0MB/s in 0.3s

2017-06-09 19:46:59 (22.0 MB/s) – ‘git-2.9.0.tar.gz’ saved [5903371/5903371]

[root@dev381 src]# ls
git-2.9.0.tar.gz
[root@dev381 src]# tar -zxvf git-2.9.0.tar.gz
git-2.9.0/
git-2.9.0/.gitattributes
git-2.9.0/.gitignore
git-2.9.0/.mailmap
git-2.9.0/.travis.yml
git-2.9.0/COPYING
git-2.9.0/Documentation/

長いので省略

 

[root@dev381 src]# ls
git-2.9.0 git-2.9.0.tar.gz

 

gccが入っているか確認&インストール

[root@dev381 src]# gcc -dumpversion
-bash: gcc: command not found

 

入っていないのでyumでインストール
[root@dev381 src]# yum install gcc
Loaded plugins: fastestmirror, langpacks
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
base | 3.6 kB 00:00:00
epel/x86_64/metalink | 5.7 kB 00:00:00
epel | 4.3 kB 00:00:00
extras | 3.4 kB 00:00:00
updates | 3.4 kB 00:00:00
(1/5): epel/x86_64/group_gz | 170 kB 00:00:00
(2/5): epel/x86_64/updateinfo | 807 kB 00:00:00
(3/5): extras/7/x86_64/primary_db | 167 kB 00:00:00
(4/5): epel/x86_64/primary_db | 4.7 MB 00:00:00
(5/5): updates/7/x86_64/primary_db | 5.6 MB 00:00:00
Determining fastest mirrors
* base: ftp.riken.jp
* epel: ftp.riken.jp
* extras: ftp.riken.jp
* updates: ftp.riken.jp
Resolving Dependencies
–> Running transaction check
—> Package gcc.x86_64 0:4.8.5-11.el7 will be installed
–> Processing Dependency: cpp = 4.8.5-11.el7 for package: gcc-4.8.5-11.el7.x86_64
–> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.8.5-11.el7.x86_64
–> Processing Dependency: libmpfr.so.4()(64bit) for package: gcc-4.8.5-11.el7.x86_64
–> Processing Dependency: libmpc.so.3()(64bit) for package: gcc-4.8.5-11.el7.x86_64
–> Running transaction check
—> Package cpp.x86_64 0:4.8.5-11.el7 will be installed
—> Package glibc-devel.x86_64 0:2.17-157.el7_3.2 will be installed
–> Processing Dependency: glibc-headers = 2.17-157.el7_3.2 for package: glibc-devel-2.17-157.el7_3.2.x86_64
–> Processing Dependency: glibc = 2.17-157.el7_3.2 for package: glibc-devel-2.17-157.el7_3.2.x86_64
–> Processing Dependency: glibc-headers for package: glibc-devel-2.17-157.el7_3.2.x86_64
—> Package libmpc.x86_64 0:1.0.1-3.el7 will be installed
—> Package mpfr.x86_64 0:3.1.1-4.el7 will be installed
–> Running transaction check
—> Package glibc.x86_64 0:2.17-157.el7_3.1 will be updated
–> Processing Dependency: glibc = 2.17-157.el7_3.1 for package: glibc-common-2.17-157.el7_3.1.x86_64
—> Package glibc.x86_64 0:2.17-157.el7_3.2 will be an update
—> Package glibc-headers.x86_64 0:2.17-157.el7_3.2 will be installed
–> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.17-157.el7_3.2.x86_64
–> Processing Dependency: kernel-headers for package: glibc-headers-2.17-157.el7_3.2.x86_64
–> Running transaction check
—> Package glibc-common.x86_64 0:2.17-157.el7_3.1 will be updated
—> Package glibc-common.x86_64 0:2.17-157.el7_3.2 will be an update
—> Package kernel-headers.x86_64 0:3.10.0-514.21.1.el7 will be installed
–> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================
Package Arch Version Repository Size
===============================================================================================================
Installing:
gcc x86_64 4.8.5-11.el7 base 16 M
Installing for dependencies:
cpp x86_64 4.8.5-11.el7 base 5.9 M
glibc-devel x86_64 2.17-157.el7_3.2 updates 1.1 M
glibc-headers x86_64 2.17-157.el7_3.2 updates 669 k
kernel-headers x86_64 3.10.0-514.21.1.el7 updates 4.8 M
libmpc x86_64 1.0.1-3.el7 base 51 k
mpfr x86_64 3.1.1-4.el7 base 203 k
Updating for dependencies:
glibc x86_64 2.17-157.el7_3.2 updates 3.6 M
glibc-common x86_64 2.17-157.el7_3.2 updates 11 M

Transaction Summary
===============================================================================================================
Install 1 Package (+6 Dependent packages)
Upgrade ( 2 Dependent packages)

Total download size: 44 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/9): glibc-2.17-157.el7_3.2.x86_64.rpm | 3.6 MB 00:00:00
(2/9): glibc-devel-2.17-157.el7_3.2.x86_64.rpm | 1.1 MB 00:00:00
(3/9): glibc-headers-2.17-157.el7_3.2.x86_64.rpm | 669 kB 00:00:00
(4/9): cpp-4.8.5-11.el7.x86_64.rpm | 5.9 MB 00:00:00
(5/9): libmpc-1.0.1-3.el7.x86_64.rpm | 51 kB 00:00:00
(6/9): mpfr-3.1.1-4.el7.x86_64.rpm | 203 kB 00:00:00
(7/9): kernel-headers-3.10.0-514.21.1.el7.x86_64.rpm | 4.8 MB 00:00:00
(8/9): glibc-common-2.17-157.el7_3.2.x86_64.rpm | 11 MB 00:00:01
(9/9): gcc-4.8.5-11.el7.x86_64.rpm | 16 MB 00:00:01
—————————————————————————————————————
Total 29 MB/s | 44 MB 00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Updating : glibc-common-2.17-157.el7_3.2.x86_64 1/11
Updating : glibc-2.17-157.el7_3.2.x86_64 2/11
Installing : mpfr-3.1.1-4.el7.x86_64 3/11
Installing : libmpc-1.0.1-3.el7.x86_64 4/11
Installing : cpp-4.8.5-11.el7.x86_64 5/11
Installing : kernel-headers-3.10.0-514.21.1.el7.x86_64 6/11
Installing : glibc-headers-2.17-157.el7_3.2.x86_64 7/11
Installing : glibc-devel-2.17-157.el7_3.2.x86_64 8/11
Installing : gcc-4.8.5-11.el7.x86_64 9/11
Cleanup : glibc-common-2.17-157.el7_3.1.x86_64 10/11
Cleanup : glibc-2.17-157.el7_3.1.x86_64 11/11
Verifying : glibc-2.17-157.el7_3.2.x86_64 1/11
Verifying : glibc-devel-2.17-157.el7_3.2.x86_64 2/11
Verifying : glibc-headers-2.17-157.el7_3.2.x86_64 3/11
Verifying : mpfr-3.1.1-4.el7.x86_64 4/11
Verifying : glibc-common-2.17-157.el7_3.2.x86_64 5/11
Verifying : libmpc-1.0.1-3.el7.x86_64 6/11
Verifying : kernel-headers-3.10.0-514.21.1.el7.x86_64 7/11
Verifying : gcc-4.8.5-11.el7.x86_64 8/11
Verifying : cpp-4.8.5-11.el7.x86_64 9/11
Verifying : glibc-common-2.17-157.el7_3.1.x86_64 10/11
Verifying : glibc-2.17-157.el7_3.1.x86_64 11/11

Installed:
gcc.x86_64 0:4.8.5-11.el7

Dependency Installed:
cpp.x86_64 0:4.8.5-11.el7 glibc-devel.x86_64 0:2.17-157.el7_3.2
glibc-headers.x86_64 0:2.17-157.el7_3.2 kernel-headers.x86_64 0:3.10.0-514.21.1.el7
libmpc.x86_64 0:1.0.1-3.el7 mpfr.x86_64 0:3.1.1-4.el7

Dependency Updated:
glibc.x86_64 0:2.17-157.el7_3.2 glibc-common.x86_64 0:2.17-157.el7_3.2

Complete!
[root@dev381 src]#

 

準備は整ったのでいざインストールしてみるが・・・

[root@dev381 src]# ls
git-2.9.0 git-2.9.0.tar.gz
[root@dev381 src]# cd git-2.9.0/
[root@dev381 git-2.9.0]# make prefix=/usr/local
GIT_VERSION = 2.9.0
* new build flags
CC credential-store.o
In file included from cache.h:4:0,
from credential-store.c:1:
git-compat-util.h:280:25: fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>
^
compilation terminated.
make: *** [credential-store.o] Error 1

 

結局yumで昔のバージョンのgitをインストール

ファイルが足りないって言われたがどうしようもなく結局yumで昔のバージョンのgitをインストールするはめにw

[root@dev381 src]# yum install git

[root@dev381 src]# git –version
git version 1.8.3.1

 

まぁgitはそんなに使わないのでいいか

 

 

コメント

タイトルとURLをコピーしました