在 CentOS 上安装 Git 失败?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8302479/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Installing Git on CentOS failed?
提问by Nyxynyx
I am new to this, trying to install git on my VPS running on CentOS.
我是新手,试图在我在 CentOS 上运行的 VPS 上安装 git。
I tried yum install git-core
and yum install git
and both resulted in No package git-core available.
Nothing to do
. I guess git
in not in the CentOs repos.
我尝试过yum install git-core
,yum install git
并且都得到了No package git-core available.
Nothing to do
. 我猜git
不在 CentOs 存储库中。
I tried another method here: http://www.lunix.com.au/blog/install-gitosis-on-centos5/.
我在这里尝试了另一种方法:http: //www.lunix.com.au/blog/install-gitosis-on-centos5/。
Running rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
gives me the message:
跑步rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
给我的信息:
error: skipping http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm - transfer failed - Unknown or unexpected error
warning: u 0x9079f18 ctrl 0x907ad30 nrefs != 0 (download.fedora.redhat.com http)
error: skipping http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm - transfer failed - Unknown or unexpected error
warning: u 0x9079f18 ctrl 0x907ad30 nrefs != 0 (download.fedora.redhat.com http)
Is there another way to install git
?
还有其他安装方式git
吗?
UPDATE
更新
I get the following error after adding in the correct repo:
添加正确的 repo 后,我收到以下错误:
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.
I think this may be due to cPanel, so I did yum --disableexcludes=main install git
. Then it resolved the dependencies, I let it download the git package, but then it fails:
我认为这可能是由于 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
采纳答案by Tilo
Which CentOS version are you using?
你使用的是哪个 CentOS 版本?
"no package found" means that you did not configure the correct repository, or you did not configure the repository correctly
“no package found”表示你没有配置正确的仓库,或者你没有正确配置仓库
Your error message "skipping..." also points in that direction.
您的错误消息“正在跳过...”也指向那个方向。
You need to google "CentOS repository for Git" ...
您需要在 google 上搜索“CentOS 的 Git 存储库”...
this yields this result: http://www.davegardner.me.uk/blog/2010/01/29/setting-up-git-on-centos-5-server/
这产生了这个结果:http: //www.davegardner.me.uk/blog/2010/01/29/setting-up-git-on-centos-5-server/
Looks like you need to configure the EPEL repository as shown on that page.
看起来您需要配置 EPEL 存储库,如该页面所示。