git init xxxx的时候报错: fatal: git 1.7.2 or later required 表示你的git版本太低,你可以自己编译最新git源码进行安装。
步骤:
1、git clone https://github.com/git/git.git
2、make configure;make;make install
注意:若执行这个步骤后出现git-compat-util.h:215: fatal error: openssl/ssl.h: No such file or directory,可以尝试下面方法后再进行:
安装libssl-dev, 或许你发现apt-get install libssl-dev的时候失败。这个时候你要更新一下源(/etc/apt/sources.list)
deb http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid main universe restricted multiverse
deb http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-security universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-proposed universe main multiverse restricted
deb http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-backports universe main multiverse restricted
deb-src http://Ubuntu.cn99.com/ubuntu/ lucid-updates universe main multiverse restricted
|
然后进行apt-get update更新源,
或者下载:www.openssl.org/source/openssl-0.9.8e.tar.gz
首先:tar zxvf openssl-0.9.8e.tar.gz
然后:make make install 这个时候你得重新编译git
git$./configure –prefix=/usr;make;make install
另外,编译的时候可能还会出现/bin/sh: msgfmt: command not found ,
只要sudo apt-get install gettext 若不能下载,记得更新上面的源。
最后:git –version 查看是不是已经安装最新的git了。
合作联系邮箱:cofface#cofface.com(请将#替换为@)
转载请注明来源:Cofface Blog » Ubuntu10.10 64位编译安装最新git