如何在最小化安装的CentOS 7.5上编译安装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
^
编译中断。
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
终于安装成功了,可以正常使用。
相关文章
- python入门:if语句中的逻辑运算符
- python正则表达式如何统计元音?
- python入门:abs()函数
- 怎么用python3代码检查回文序列?
- python3代码怎样用字典进行数学运算?
- 如何不用循环语句实现python3字符串代码?
- python3代码之怎样用dir查看对象属性?
- emoji如何用python3代码过滤?
- 如何使用python3代码查看包的路径?
- itertools怎样对python3代码单行处理?
- 如何用print调试python3代码?
- python基础:迭代器及其使用方法
- python import如何获取上一级目录?
- 列表解析式如何使python3代码更加精简?
- python三引号怎么打
- pycharm如何画图
- python如何读取文件的数据
- python里random.randint函数如何使用?
- python列表可以求平均值吗?如何实现?
- python3中构造字典的代码怎么写?