日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux 的git的安装目录,Linux下Git安装及配置较详细-Go语言中文社区

發布時間:2025/3/19 linux 57 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux 的git的安装目录,Linux下Git安装及配置较详细-Go语言中文社区 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.下載git源碼

2.解壓安裝包

--解壓:tar -zxvf git-2.9.5.tar.gz

--移直目標文件:mv /root/git-2.9.5? /usr/git-2.9.5(使用Xftp操作也可)

--進入解壓包目錄 cd usr/git-2.9.5

3.安裝

--指定安裝目錄 ./configure? --prefix=/usr/git

./configure報錯

[root@localhost git-2.9.5]# ./configure --prefix=/home/Git configure: Setting lib to 'lib' (the default) configure: Will try -pthread then -lpthread to enable POSIX Threads. configure: CHECKS for site configuration checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/home/tools/git-2.9.5': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details

執行報錯中看出gcc,cc,cl.exe為no。gcc是linux的c語言編譯器,說明我的機器中沒有安裝這些編譯器。

分別安裝以下gcc,gcc-c++,安裝成功之后執行一下git安裝命令:

[root@localhost git-2.9.5] #? yum install gcc

[root@localhost git-2.9.5] #? yum install gcc-c++

[root@localhost git-2.9.5] #? ./configure --prefix=/usr/git

--安裝 make && make install

make命令報錯

[root@localhost git-2.9.5]# make && make install * new build flags CC credential-store.o In file included from credential-store.c:1:0: cache.h:40:18: 致命錯誤:zlib.h:沒有那個文件或目錄 #include ^ 編譯中斷。 make: *** [credential-store.o] 錯誤 1

缺少zlib的頭文件,開發包沒裝。安裝zlib

[root@localhost git-2.9.5]# yum install zlib

[root@localhost git-2.9.5]# yum install zlib-devel

[root@localhost git-2.9.5]# yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker

[root@localhost git-2.9.5]# make && make install

執行后繼續報錯,錯誤信息:

MSGFMT po/bg.msg make[1]:?*?[po/bg.msg] Error 127

解決方式:

yum install tcl build-essential tk gettext

再次執行安裝:

[root@localhost git-2.9.5]# make && make install

則安裝成功。

4.檢查git是否安裝完成

進入指定的安裝目錄,查看git版本

[root@localhost bin]# cd /usr/Git/bin

[root@localhost bin]# ./git --version

git version 2.9.5

5.配置環境變量:

vi /etc/profile

編輯配置文件,在最后追加下面的字符串,指定bin目錄地址

$PATH://usr/git/bin

修改完成之后,執行命令,生效配置文件

source /etc/profile

檢查是否配置成功,可切換路徑到其他目錄,執行 git --version。返回git版本則表示環境變量配置完成。

在安裝過程中,查到的資料鏈接如下:

總結

以上是生活随笔為你收集整理的linux 的git的安装目录,Linux下Git安装及配置较详细-Go语言中文社区的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。