美文网首页
Linux系统离线安装git(局域网)

Linux系统离线安装git(局域网)

作者: 一杯海风_3163 | 来源:发表于2020-04-22 12:44 被阅读0次
1.下载git包

https://www.kernel.org/pub/software/scm/git/
在上面链接中选择需要的git版本的包进行下载,以 git-2.9.5.tar.gz 为例,将下载好的包上传到linux系统中,这里最好自建一个git文件夹

2.安装
1.解压:
tar -vxf /usr/local/git/git-2.9.5.tar.gz
2.安装:
    cd git-2.9.5
    ./configure --prefix=/usr/local/git  # 配置git安装路径
    make && make install  # 编译并且安装,在此过程中如果报错就是因为缺少依赖包,安装即可

注意:


image.png

这样即表示安装成功,不是报错!!!正常往下走,配置环境变量即可

① 编译git时报错:
zlib.h: No such file or directory
缺少 zlib的头文件, 开发包没装,

    yum install zlib (系统默认已经装上)
    yum install zlib-devel 

②git clone时候提示fatal: Unable to find remote helper for 'https'

yum install libcurl-devel

③git安装之后出现:
git: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory

这是由于无法加载libiconv.so.2库文件.
解决方法:

# echo "/usr/local/lib" >> /etc/ld.so.conf
# /sbin/ldconfig
3.配置环境变量:
    export GIT_PATH=/usr/local/git/bin
    export PATH=$JAVA_HOME/bin:$PATH:$GIT_PATH
    source /etc/profile
4.验证:
git --version

更多详细问题请参考:https://www.cnblogs.com/AllIhave/p/11297562.html

相关文章

  • Linux系统离线安装git(局域网)

    1.下载git包 https://www.kernel.org/pub/software/scm/git/在上面链...

  • git基本使用

    一、安装git linux上安装git 首先输入git,检测系统是否安装git 如果是Debian或者Ubuntu...

  • Git教程——安装

    在Linux上安装Git 首先,你可以试着输入git,看看系统有没有安装Git: 像上面的命令,有很多Linux会...

  • Git上传文件到远程仓库

    一、安装Git 1、Linux 首先,你可以试着输入git,看看系统有没有安装Git: $ git The pro...

  • 2. Git 安装和基本配置

    Git 安装 Linux 上安装 Git 首先,你可以试着输入git,看看系统有没有安装 Git 像上面的命令,有...

  • git安装和使用

    git的安装 在Linux上安装Git Debian/Ubuntu Git 安装命令为: 如果你使用的系统是 Ce...

  • Git管理员Guide

    Git管理员guide 一、安装git 在Linux上安装装git 首先,你可以试着输入git,看看系统有没有安装...

  • 2. Git客户端安装

    安装git Linux上安装Git 首先,你可以试着输入git,看看系统有没有安装Git 像上面的命令,有很多Li...

  • 安装Git(第2篇)

    在Linux系统安装Git 最早的Git就是在Linux上开发的。所以很多Linux默认自带了Git,你可以先试试...

  • 2018-05-22(相关软件安装)

    一、git安装 二、lombok离线安装

网友评论

      本文标题:Linux系统离线安装git(局域网)

      本文链接:https://www.haomeiwen.com/subject/crgbihtx.html