VMware Workstation已经采用最小化安装CentOS7,显示版本为CentOS7.5,准备采用yum安装git。

采用yum list git发现可安装的GIT软件包版本1.8.3.1,新的版本已经是2.19了,因此,我决定编译安装git2.19。

由于采用最小化安装系统,编译时出现一些问题,这里对处理过程作一下备忘:

1、首先在git官网上下载最新的版本,下载地址:https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.19.0.tar.gz

2、由于采用win10操作系统下载的文件,需要上传到CentOS7上,操作方式我一般通过SecureCRT采用SSH2协议登录,

上传文件也通过SecureCRT工具中的SFTP协议,具体方法如图:

注意:上传的文件会在登录用户的home目录下,可以通过lpwd查看本地目录,pwd查看远端目录

3、对文件解压:tar   xzvf   git-2.19.0.tar.gz

4、进入解压后的git目录后,安装方式参考:https://github.com/git/git/blob/master/INSTALL或目录下的INSTALL,这里采用建议步骤:

# make configure ;# as yourself
# ./configure --prefix=/usr ;# as yourself
# make all doc ;# as yourself
# make install install-doc install-html;# as root

5、首先执行make configure,开始就出错了,提示:

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 `/opt/git-2.19.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

通过yum provides gcc和 yum provides cc查询到c编译器没有安装,yum -y install gcc安装gcc包及对应的依赖。

6、再次执行make configure,再次出现如下错误:

GIT_VERSION = 2.19.0
GEN configure
/bin/sh: autoconf: 未找到命令
make: *** [configure] 错误 127

 通过yum provides autoconf查询到没有安装autoconf,yum -y install autoconf安装包及对应的依赖。

7、再一次执行make configure,正常了,接下来 ./configure很顺利。

8、执行make all doc,又出现错误:

* new build flags
CC credential-store.o
In file included from credential-store.c:1:0:
cache.h:20:18: 致命错误:zlib.h:没有那个文件或目录
#include <zlib.h>
^
编译中断。
make: *** [credential-store.o] 错误 1

错误指出没有zlib,yum -y install zlib安装,发现已经安装,zlib.h应该是对应的开发包没有,yum -y install zlib-devel安装开发包

9、再执行make all doc,再出现错误:

/bin/sh:行1: asciidoc: 未找到命令
make[1]: *** [git-init-db.html] 错误 127
make[1]: 离开目录“/opt/git-2.19.0/Documentation”
make: *** [doc] 错误 2

没有asciidoc命令,yum list asciidoc发现包没有安装,yum -y install asciidoc安装该包。

10、再一次执行make all doc,仍出现错误:

/bin/sh:行1: xmlto: 未找到命令
make[1]: *** [git-init-db.1] 错误 127
make[1]: 离开目录“/opt/git-2.19.0/Documentation”
make: *** [doc] 错误 2

思路一样,没有xmlto命令,yum list xmlto发现包没有安装, yum -y install xmlto安装该包,执行make all doc这下很顺利。

11、执行make install install-doc install-html,这下安装很顺利,没有再提示错误。

12、测试一下,执行git --version正常显示:

git version 2.19.0

终于安装成功了,可以正常使用。

13、按上面的库虽然安装成功了,但有一个问题,就是采用Https方式push到github上,或clone到本地的时候就出错了,主要错误提示是:

“fatal: 无法为 'https' 找到远程助手”

直接通过curl https://github.com了产生同样的错误,判断应该是编译时没有SSL这块的东西,查了一些贴子,各种说法都有,

升级curl到最新版本也没用,最后认真看一下官方手册,参考:https://git-scm.com/book/zh/v2/%E8%B5%B7%E6%AD%A5-%E5%AE%89%E8%A3%85-Git

同时,对比一下安装上述库和没有安装时进行./configure --prefix=/usr后进结果发现:

没有全部安装上述GIT依赖的库 全部安装上述GIT依赖的库

configure: CHECKS for libraries
checking for SHA1_Init in -lcrypto... no
checking for SHA1_Init in -lssl... no
checking for curl_global_init in -lcurl... no
checking for XML_ParserCreate in -lexpat... no
checking for iconv in -lc... yes
checking for deflateBound in -lz... no
checking for socket in -lc... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for hstrerror... yes
checking for basename in -lc... yes
checking for gettext in -lc... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes

configure: CHECKS for libraries
checking for SHA1_Init in -lcrypto... yes
checking for curl_global_init in -lcurl... yes
checking for curl-config... curl-config
checking if Curl supports SSL... yes
checking for XML_ParserCreate in -lexpat... yes
checking for iconv in -lc... yes
checking for deflateBound in -lz... yes
checking for socket in -lc... yes
checking for inet_ntop... yes
checking for inet_pton... yes
checking for hstrerror... yes
checking for basename in -lc... yes
checking for gettext in -lc... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes

总结一下:

没按要求安装 Git 依赖的库时,本地git功能使用没有问题,采用SSH方式push到github也没有问题,就是不能采用https方式。

要正常使用git的https方式push,必须安装下列库后再编译:

yum install  gcc perl-ExtUtils-MakeMaker

yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel asciidoc xmlto

另外 ,curl命令访问https域名出问题时,可能的原因是nss版本有点旧了,yum -y update nss更新一下就可以正常使用。

最小化安装的centos7.5上编译安装git2.19的更多相关文章

  1. 尝试在CentOS7.2上编译安装Swift

    苹果提供 Ubuntu上构建Swift 的教程,通过这个教程我尝试使用CentOS7.2上玩儿一把.目前已经成功在CentOS7.2上班成功安装 swift 4.0 https://github.co ...

  2. centos7.3上编译安装percona5.7.18

    一,删除操作系统自带mariadb yum remove mariadb 二,下载需要的安装包 percona-toolkit-3.0.3-1.el7.x86_64.rpm boost_1_59_0. ...

  3. centos7源码编译安装lamp/lnmp

    centos7源码编译安装lamp/lnmp 进程:是包工头(相当于是个门,只管开门关门,不管门内的事儿) 线程:是各种工种(cpu调度的是线程) 进程 是一件事情, 线程 是 同一个时间范围内 同时 ...

  4. centos7.2下编译安装&&使用-git代码库

    centos7.2下编译安装git Git简介 Git是一个分布式版本控制系统 Git vs SVN SVN是典型的集中式版本控制起,版本库集中存放在服务器,当我们用自己的电脑干活儿的时候,需要先从中 ...

  5. CentOS-7.3.1611编译安装 Nginx-1.12.1+mysql-5.7.19+PHP-7.1.8+zabbix-3.4.1

    CentOS-7.3.1611编译安装 Nginx-1.12.1+mysql-5.7.19+PHP-7.1.8+zabbix-3.4.1 下载软件 1.下载nginx http://nginx.org ...

  6. Linux上编译安装PHP

    这篇文章主要介绍了关于Linux上编译安装PHP,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下 之前在服务器上编译安装了PHP运行环境,但是安装完过了一段时间就差不多忘记了,只是零零星 ...

  7. 在centOS7.2上编译gcc4.4.7

    1.前置 首先,可以参考我的上篇文章,在centOS7.2上编译gcc4.1.2,过程基本一致,这里只对可能遇到的错误情况进行说明. 2.安装texinfo4.8 我的centos7.2版本,自带的是 ...

  8. centos7.6环境下编译安装tengine-2.2.2的编译安装

    centos7.6环境下编译安装tengine-2.2.2的编译安装 .获取tengine2..2的源码包 http://tengine.taobao.org/download/tengine-2.2 ...

  9. Kubernetes+Docker的云平台在CentOS7系统上的安装

    Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...

随机推荐

  1. Unity3d项目入门之虚拟摇杆

    Unity本身不提供摇杆的组件,开发者可以使用牛逼的EasyTouch插件或者应用NGUI实现相关的需求,下面本文通过Unity自身的UGUI属性,实现虚拟摇杆的功能. 主参考 <Unity:使 ...

  2. tmux复制模式

    复制模式支持滚屏等操作,进入方法为Ctrl + b再按"[",此时进入所谓的copy-mode 然后就可以用上下键或PageDn/PageUp浏览屏幕了. 想退出copy-mode ...

  3. VMware 中安装KVM,模块不加载

    # yum -y install qemu-kvm libvirt virt-install bridge-utils 通过以上命令在VMWare中centos7安装KVM模块 安装后使用 #lsmo ...

  4. 服务监控-zabbix监控指标

    1.cpu unitzation 监控cpu的整体状态. 使用Zabbix查看CPU利用率,会有下面几个值: CPU idle time:空闲的cpu时间比[简称id] CPU user time:用 ...

  5. centos 安装nvm和node.js

    #安装githubyum install git -y #下载nvmgit clone git://github.com/creationix/nvm.git ~/nvm #设置nvm 自动运行;ec ...

  6. L2范数的相关求解

    https://blog.csdn.net/u010725283/article/details/79212762

  7. 线程池ThreadPoolExecutor源码分析

    在阿里编程规约中关于线程池强制了两点,如下: [强制]线程资源必须通过线程池提供,不允许在应用中自行显式创建线程.说明:使用线程池的好处是减少在创建和销毁线程上所消耗的时间以及系统资源的开销,解决资源 ...

  8. Maven中阿里云私服配置

    在国内maven仓库连接速度太慢 ,虽然对于很多互联网企业和大中型软件公司,建个镜像是分分钟的事.但对于个人开发者确实是个问题.解决办法可以用阿里云的MAVEN私服.有两种方法: 1.在$MAVEN_ ...

  9. 移动端各种滚动场景需求的插件better-scroll

    移动端各种滚动场景需求的插件: 文档地址: better-scroll:https://ustbhuangyi.github.io/better-scroll/doc/zh-hans/#better- ...

  10. thinkphp5随机查询数据

    ThinkPHP5从V5.0.17之后,如果排序使用到SQL函数,要用orderRaw()代替order()进行排序. 例:Db::name('user')->orderRaw('rand()' ...