百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> CentOS上安装Git与编译安装git出错
分享文章到:

CentOS上安装Git与编译安装git出错

发布时间:01/15 来源: 浏览: 关键词:
今天我来给大家介绍一下关于在CentOS5上编译安装Git,因为CentOS 5的yum源中没有git所以我们只能这样做了,下面来给各位介绍一下相关安装过程与碰到问题解决办法。

编译基础环境环境

 代码如下
yum -y install gcc make

 
确保已安装了依赖的包

 代码如下
yum install -y curl curl-devel zlib-devel openssl-devel perl perl-devel cpio expat-devel gettext-devel

 
下载最新的git包

 代码如下
wget http://www.codemonkey.org.uk/projects/git-snapshots/git/git-latest.tar.gz
tar xzvf git-latest.tar.gz
cd git-2012-07-05 #你的目录可能不是这个
autoconf
./configure
make && make install

 
检查下安装的版本,大功告成

 代码如下
[root@cobbler git-2012-07-05]# git --version
git version 1.7.11.GIT

 
 
编译时遇到错误讯息及解决方法:

make[1]: Warning: File `Makefile' has modification time 3e+06 s in the future
/usr/bin/perl Makefile.PL PREFIX='/usr/local' INSTALL_BASE='' --localedir='/usr/local/share/locale'
Writing perl.mak for Git
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
    GEN git-add--interactive
make[1]: Warning: File `Makefile' has modification time 3e+06 s in the future
Writing perl.mak for Git
make[2]: Warning: File `Makefile.PL' has modification time 3e+06 s in the future
Use of uninitialized value $localedir in concatenation (.) or string at Makefile.PL line 52.
Writing perl.mak for Git
make[2]: *** [perl.mak] Error 1
make[1]: *** [instlibdir] Error 2
make: *** [git-add--interactive] Error 2

在网上搜索了一些,根据出错的warning发现是机器时间设置的问题。。是机器系统的时间比版本的时间早。所以要系统时间重新设置。
 
我自己使用的是centos6由于CentOS6中yum源中已经有git的版本了,可以直接使用yum源进行安装

 代码如下

yum -y install git

目前yum源中的git版本如下

 代码如下
[root@cobbler ~]# git --version
git version 1.7.1

我在编译安装git时出现一个小问题,下面给大家贴出来供大家参考。

1.下载git版本

 代码如下
wget http://git-core.googlecode.com/files/git-1.7.10.1.tar.gz
wget http://git-core.googlecode.com/files/git-manpages-1.7.10.1.tar.gz

2.在make编译git的时候报下面的错误:
make[1]: Warning: File `Makefile' has modification time 2.5e+07 s in the future
/usr/bin/perl Makefile.PL PREFIX='/usr/local'
Writing perl.mak for Git
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
    GEN git-add--interactive
make[1]: Warning: File `Makefile' has modification time 2.5e+07 s in the future
Writing perl.mak for Git
make[2]: Warning: File `Makefile.PL' has modification time 2.5e+07 s in the future
Writing perl.mak for Git
make[2]: *** [perl.mak] Error 1
make[1]: *** [instlibdir] Error 2
make: *** [git-add--interactive] Error 2

网上搜了下,根据出错的warning发现是机器时间设置的问题,重新设置下机器时间就搞定了:

 代码如下
ntpdate time.nist.gov

3.安装完后,想使用在线帮助报下面的错:

 代码如下
[root@test ~]# man git
No manual entry for git

解压git-manpages-1.7.10.1.tar.gz到/usr/share/man目录下就可以了.这个包是编译好的,不是源码的安装包.

 代码如下
tar zxf git-manpages-1.7.10.1.tar.gz -C /usr/share/man

这样就可以使用man git了.

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有9人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板