2017. 11. 21. 13:12 Node.js/Git

1. Git 설치

git을 설치하기 전의 나의 OS 부터 확인


uname

 Linux  // OS 이름 

uname -r


3.10.0-327.el7.x86_64 // 커널 정보


cat /etc/*release  // OS 정보 확인 


CentOS Linux release 7.2.1511 (Core)

NAME="CentOS Linux"

VERSION="7 (Core)"

ID="centos"

ID_LIKE="rhel fedora"

VERSION_ID="7"

PRETTY_NAME="CentOS Linux 7 (Core)"

ANSI_COLOR="0;31"

CPE_NAME="cpe:/o:centos:centos:7"

HOME_URL="https://www.centos.org/"

BUG_REPORT_URL="https://bugs.centos.org/"


CENTOS_MANTISBT_PROJECT="CentOS-7"

CENTOS_MANTISBT_PROJECT_VERSION="7"

REDHAT_SUPPORT_PRODUCT="centos"

REDHAT_SUPPORT_PRODUCT_VERSION="7"


CentOS Linux release 7.2.1511 (Core)

CentOS Linux release 7.2.1511 (Core)



getconf LONG_BIT  // 비트 확인 

64


내 OS는 CentOS 7.X 버전 사용중이며 커널은 리눅스 커널 3.10 에 64비트 임을 알겠다.

git HomePage 접속


Downloads 클릭 후 에 들어가서  Linux/Unix 를 선택한다.

그러면 종류별로 설치법에 대해 나온다.

https://git-scm.com/download/linux    // 해당 Downloads 링크 

CentOS 의 경우에는 git을 1.8 까지만 해주기 때문에 (Base Repo 로 git 설치시 1.8.3 버전만 깔림을 확인)

Red Hat Enterprise Linux, Oracle Linux, CentOS, Scientific Linux, et al.

RHEL and derivatives typically ship older versions of git. You can download a tarball and build from source, or use a 3rd-party repository such as the IUS Community Project to obtain a more recent version of git.  (사이트 발췌)

와 같이 나와있다 tarball을 다운받아서 소스코드 빌드를 하던지 아니면 IUS  레포를  최신 버전의 깃이 포함된 레포를 통해서 받으라는건데 소스코드 빌드가 간단해 보여 tarball 링크를 클릭해서 들어간다.


들어가면 리스트에 git-htmldocs, git-manpages , git - 이있을건데

이 당일 가장 최신은  8월 10일자 17:57분 자 인 git-2.9.5.tar.xz 파일을 다운로드 하여서

압축을 푼다 

/home/test/다운로드/git-2.9.5.tar.xz 에 있는 경로를 가정시에


1 . tar -xvf /home/test/다운로드/git-2.9.5.tar.xz  

git-2.9.5.tar 폴더가 생성된다.

해당 폴더로 이동 

2. cd /home/test/다운로드/git-2.9.5

3. make install 

3-1 make install 보다는 prefix를 지정해주는 것이 더 좋다

-> make prefix =/usr/local/ install 

하면 설치가 완료 된다.

설치 완료 후 git--version 

로 git 버전을 확인할수 있다.


** 설치가 안되는 경우 (make install 이 안되는 경우)  ( OS는 CentOS 7.0 기준입니다. )

사실 글 작성 이유가 이 건데 make install 시에 한번에 되지가 않았다.


1. curl/curl.h not found // 분명히 curl은 깔려있었는데

-> yum install libcurl-devel 

후 make install


2. 1 번을 행하여도 에러가 난다. (본인이 그랬)

[make 시 에러]

xml/apr_xml.c : fatal error: expat.h: 그런 파일이나 디렉터리가 없습니다

 #include <expat.h>

-> yum install expat-devel  

후  make install

(여기까지 하면 웬만하면 설치가 완료 될 것이다.)



*** 위의 방법으로도 설치가 안되는 경우에는 repo를 다시 세팅 해본다.

(본인은 설치전의 repo를 다 날려버려서 rm -rf /etc/yum.repo.d // ㅜㅜ )

1. /etc/yum.repo.d/epel.repo  생성 // yum.repo.d 폴더가 없다면 /etc/뒤에 생성 모든 권한은 ROOT로 하셔야합니다.

epel.repo 


[epel]

 name=Extra Packages for Enterprise Linux 7 - $basearch

 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch

 failovermethod=priority

 enabled=1

 gpgcheck=1

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


 [epel-debuginfo]

 name=Extra Packages for Enterprise Linux 7 - $basearch - Debug

 #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch

 failovermethod=priority

 enabled=0

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 gpgcheck=1


 [epel-source]

 name=Extra Packages for Enterprise Linux 7 - $basearch - Source

 #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch

 failovermethod=priority

 enabled=0

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 gpgcheck=1


/etc/yum.repo.d/epel-testing.repo


 [epel-testing]

 name=Extra Packages for Enterprise Linux 7 - Testing - $basearch

 #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel7&arch=$basearch

 failovermethod=priority

 enabled=0

 gpgcheck=1

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


 [epel-testing-debuginfo]

 name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Debug

 #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/$basearch/debug

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel7&arch=$basearch

 failovermethod=priority

 enabled=0

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 gpgcheck=1


 [epel-testing-source]

 name=Extra Packages for Enterprise Linux 7 - Testing - $basearch - Source

 #baseurl=http://download.fedoraproject.org/pub/epel/testing/7/SRPMS

 mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel7&arch=$basearch

 failovermethod=priority

 enabled=0

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7

 gpgcheck=1


2. /etc/yum.repo.d/Centos-Base.repo

생성 
Centos-Base.repo



[base]

name=CentOS-$releasever - Base

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates 


[updates]

name=CentOS-$releasever - Updates

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 


#additional packages that may be useful

[extras]

name=CentOS-$releasever - Extras

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-


#additional packages that extend functionality of existing packages

[centosplus]

name=CentOS-$releasever - Plus

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra

#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/

gpgcheck=1

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7



두 레포를 지정 후 저장

yum clean
yum update

후에 다시 위의 


1. curl/curl.h not found // 분명히 curl은 깔려있었는데 <---- 이 부분 부터 하면 git설치가 될겁니다.


'Node.js > Git' 카테고리의 다른 글

[Git] Branch 세팅 ( 새로운 브랜치 만들기 )  (0) 2022.02.25
Posted by 깍돌이

블로그 이미지
QA를 업으로 삼고 있습니다.
깍돌이

태그목록

Yesterday
Today
Total

달력

 « |  » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함