yum安装git
http://blog.csdn.net/laiahu/article/details/7516939
yum install git 出现错误:
[root@myhost test]# yum install git
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror.neu.edu.cn
*base: mirror.neu.edu.cn
* extras: mirror.neu.edu.cn
* updates: mirror.neu.edu.cn
addons | 951 B 00:00
base |2.1 kB 00:00
extras |2.1 kB 00:00
updates |1.9 kB 00:00
Setting up InstallProcess
Nopackage git available.
Nothing to do
解决办法:
![]() |
需要先添加EPEL(Extra Packages for Enterprise Linux) repository: CentOS5.x 32-bit(x86/i386): rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm CentOS5.x 64-bit(x64): rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm CentOS6.x32-bit (x86/i386):
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm CentOS6.x 64-bit(x64): rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm |
然后yum install git
就能安装了。
http://www.ccvita.com/370.html
CentOS的yum源中没有git,只能自己编译安装,现在记录下编译安装的内容,留给自己备忘。
确保已安装了依赖的包
yum install curl |
yum install curl-devel |
yum install zlib-devel |
yum install openssl-devel |
yum install perl |
yum install cpio |
yum install expat-devel |
yum install 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-2011-11-30#你的目录可能不是这个 |
autoconf |
./configure |
make |
sudo make install |
检查下安装的版本,大功告成
git --version |