zoukankan      html  css  js  c++  java
  • centos7源码安装github

    当前时间:2019年3月3日

    资源:

    github下载地址:https://mirrors.edge.kernel.org/pub/software/scm/git/

    环境准备:

    [root@sonny ~]# 
    yum install curl-devel expat-devel gettext-devel 
    openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    [root@sonny ~]# mkdir /root/git  # github安装位置
    

    安装:

    # 当前目录/opt/download,git-2.8.6.tar.gz安装包已经在该目录
    [root@sonny ~]# tar zxvf git-2.8.6.tar.gz
    [root@sonny ~]# ./configure --prefix=/root/git
    [root@sonny ~]# make && make install
    

    备注:
    centos6需要更新openssl,加载configure文件需要使用 --with-openssl=/usr/local/openssl
    https://blog.51cto.com/13544424/2149473

    设置环境变量:

    [root@sonny ~]# touch /etc/profile.d/git.sh
    [root@sonny ~]# echo "export PATH=$PATH:/root/git/bin" >> /etc/profile.d/git.sh
    [root@sonny ~]# source /etc/profile
    

    测试:

    [root@sonny ~]# git --version
    

    使用shell脚本安装:

    • 在centos里下载安装包
    yum install -y wget
    wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.8.6.tar.gz
    

    编写git.sh文件,将以下内容粘贴进去,然后让脚本具有执行权限:chmod +x ./git.sh
    git按转包和git.sh要在/opt/download目录里
    执行脚本:source git.sh

    !/bin/bash
    # 当前目录/opt/download,且安装包已经下载
    yum install -y curl-devel expat-devel gettext-devel 
    openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
    mkdir /usr/local/git
    
    # 安装
    tar zxvf git-2.8.6.tar.gz
    cd git-2.8.6
    ./configure --prefix=/usr/local/git
    make && make install
    
    # 设置环境变量
    touch /etc/profile.d/git.sh
    echo "export PATH=$PATH:/usr/local/git/bin" >> /etc/profile.d/git.sh
    source /etc/profile
    
    # 测试
    git --version
    
    Hole yor life get everything if you never give up.
  • 相关阅读:
    隔壁小孩都要知道的Drupal配置
    Cobaltstrike、armitage联动
    YxCMS 1.4.7 最新版漏洞分析
    业务逻辑漏洞探索之暴力破解
    刺透内网的HTTP代理
    pwn入门之栈溢出练习
    史上最完整的MySQL注入
    ISG 2018 Web Writeup
    3-4 计算长方形的周长和面积
    【Lucene4.8教程之二】索引
  • 原文地址:https://www.cnblogs.com/1fengchen1/p/13998062.html
Copyright © 2011-2022 走看看