解决linux redhat6下安装git的问题
今天用到linux上的git安装过程比较曲折,记录一下:
首先会报需要perl
rpm -ivh git-1.7.1-14.2.x86_64.rpm
warning: git-1.7.1-14.2.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID c428b69d: NOKEY
error: Failed dependencies:
perl is needed by git-1.7.1-14.2.x86_64
perl(Error) is needed by git-1.7.1-14.2.x86_64
perl(Git) is needed by git-1.7.1-14.2.x86_64
perl-Git = 1.7.1-14.2 is needed by git-1.7.1-14.2.x86_64
安装完perl后,还会报
error: Failed dependencies:
perl(Error) is needed by git-1.7.1-14.2.x86_64
perl(Git) is needed by git-1.7.1-14.2.x86_64
perl-Git = 1.7.1-14.2 is needed by git-1.7.1-14.2.x86_64
还需要安装perl-Error-0.17015-4.el6.noarch.rpm,安装也顺利,下面要安装perl-git,但是问题来了:
[root@localhost Packages]# rpm -ihv --aid perl-Git-1.7.1-2.el6_0.1.noarch.rpm
warning: perl-Git-1.7.1-2.el6_0.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
error: Failed dependencies:
git = 1.7.1-2.el6_0.1 is needed by perl-Git-1.7.1-2.el6_0.1.noarch
rpm -ivh git-1.7.1-14.2.x86_64.rpm
warning: git-1.7.1-14.2.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID c428b69d: NOKEY
error: Failed dependencies:
perl(Error) is needed by git-1.7.1-14.2.x86_64
perl(Git) is needed by git-1.7.1-14.2.x86_64
perl-Git = 1.7.1-14.2 is needed by git-1.7.1-14.2.x86_64
两者相互依赖!最终方法是同时安装:
[root@localhost Packages]# rpm -ivf perl-Git-1.7.1-2.el6_0.1.noarch.rpm git-1.7.1-2.el6_0.1.x86_64.rpm
warning: perl-Git-1.7.1-2.el6_0.1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
Preparing packages for installation...
git-1.7.1-2.el6_0.1
perl-Git-1.7.1-2.el6_0.1
[root@localhost Packages]#
[zl@localhost ~]$ git --version
git version 1.7.1
安装成功!