2
1

More than 3 years have passed since last update.

CentOS8.2にgitインストール

Last updated at Posted at 2020-12-01
# git --version
-bash: git: コマンドが見つかりません

方法1:dnfでインストール

# dnf -y install git
...
# git --version
git version 2.18.4

# which git
/usr/bin/git

方法2:ソースから最新版をインストール

# dnf -y install wget make

# cd /usr/local/src
# wget https://www.kernel.org/pub/software/scm/git/git-2.29.2.tar.gz
# tar zxf git-2.29.2.tar.gz

# cd git-2.29.2
# make prefix=/usr/local all
# ↓makeすると出るエラーにそれぞれ対応

make: curl-config: コマンドが見つかりませんでした
# dnf -y install curl-devel

/bin/sh: cc: コマンドが見つかりません
# dnf -y install gcc

git-compat-util.h:301:10: 致命的エラー: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
# dnf install openssl-devel

http-push.c:22:10: 致命的エラー: expat.h: No such file or directory
 #include <expat.h>
# dnf -y install expat-devel


# make prefix=/usr/local all
# make prefix=/usr/local install

# git --version
git version 2.29.2

# which git
/usr/local/bin/git

備忘録です。

2
1
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
2
1