Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在CentOS上安装Git失败?_Git_Github_Centos - Fatal编程技术网

在CentOS上安装Git失败?

在CentOS上安装Git失败?,git,github,centos,Git,Github,Centos,我是新手,尝试在CentOS上运行的VPS上安装git 我尝试了yum安装git-core和yum安装git,结果都是没有可用的包git-core。 无事可做。我猜在CentOs回购协议中没有git 我在这里尝试了另一种方法: 运行rpm-Uvhhttp://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm向我传达了以下信息: 错误:正在跳过http://download.fedora.redhat.co

我是新手,尝试在CentOS上运行的VPS上安装git

我尝试了
yum安装git-core
yum安装git
,结果都是
没有可用的包git-core。
无事可做
。我猜在CentOs回购协议中没有git

我在这里尝试了另一种方法:

运行
rpm-Uvhhttp://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
向我传达了以下信息:

错误:正在跳过http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm -传输失败-未知或意外错误
警告:u 0x9079f18 ctrl 0x907ad30 nrefs!=0(下载:fedora.redhat.com http)

是否有其他方法安装
git

更新

在添加正确的回购协议后,我出现以下错误:

Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.i386 0:1.7.4.1-1.el5 set to be updated
--> Processing Dependency: perl-Git = 1.7.4.1-1.el5 for package: git
--> Processing Dependency: perl(Error) for package: git
--> Processing Dependency: perl(Git) for package: git
--> Finished Dependency Resolution
git-1.7.4.1-1.el5.i386 from epel has depsolving problems
  --> Missing Dependency: perl(Git) is needed by package git-1.7.4.1-1.el5.i386 (epel)
git-1.7.4.1-1.el5.i386 from epel has depsolving problems
  --> Missing Dependency: perl-Git = 1.7.4.1-1.el5 is needed by package git-1.7.4.1-1.el5.i386 (epel)
git-1.7.4.1-1.el5.i386 from epel has depsolving problems
  --> Missing Dependency: perl(Error) is needed by package git-1.7.4.1-1.el5.i386 (epel)
Error: Missing Dependency: perl-Git = 1.7.4.1-1.el5 is needed by package git-1.7.4.1-1.el5.i386 (epel)
Error: Missing Dependency: perl(Git) is needed by package git-1.7.4.1-1.el5.i386 (epel)
Error: Missing Dependency: perl(Error) is needed by package git-1.7.4.1-1.el5.i386 (epel)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.
我想这可能是由于cPanel的缘故,所以我做了
yum--disableexcludes=main install git
。然后它解决了依赖关系,我让它下载git包,但它失败了:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 217521f6
GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory:             
/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

您使用的是哪个CentOS版本

“未找到包”表示您未配置正确的存储库,或者未正确配置存储库

您的错误消息“跳过…”也指向该方向

你需要谷歌“CentOS Git存储库”

这将产生以下结果:


看起来您需要按照该页面所示配置EPEL存储库。

您可以从源代码构建它。但我非常怀疑CentOS没有可用的git软件包。@ThiefMaster嗯,我确实
yum install git
,它说找不到git软件包……这意味着您没有配置正确的存储库,或者没有正确配置存储库谢谢,我尝试了,但出现了一个缺少依赖项的错误。我尝试了
yum-install-perl
yum-install-perl-git
,但是第一个没有做任何事情,第二个说没有perl-git包。更新了带有错误消息的帖子。通过编译二进制代码解决了这个问题!这省去了很多麻烦!