git - 在 CentOS 上安装 Git 失败?

标签 git github centos

<分区>

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

我尝试了 yum install git-coreyum install git 都导致了 No package git-core available。 无事可做。我猜 git 不在 CentOs 仓库中。

我在这里尝试了另一种方法:http://www.lunix.com.au/blog/install-gitosis-on-centos5/ .

运行 rpm -Uvh http://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 (download.fedora.redhat.com http)

还有其他安装git的方法吗?

更新

添加正确的 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.

我认为这可能是由于 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 版本?

“找不到包”意味着你没有配置正确的版本库,或者你没有正确配置版本库

您的错误消息“skipping...”也指向那个方向。

你需要用谷歌搜索“Git 的 CentOS 存储库”......

这会产生这样的结果:http://www.davegardner.me.uk/blog/2010/01/29/setting-up-git-on-centos-5-server/

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

关于git - 在 CentOS 上安装 Git 失败?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8302479/

相关文章:

Git:如何忽略快进并将原点[分支]恢复到较早的提交?

git log 只查看新条目

linux - 如何更改samba客户端windows 7用户访问samba密码、用户站点?

linux - centos 7.5 (vesta) 上出现内部错误 500。暂停?

GitHub:从 wiki 页面链接到问题

centos - 如何将 .tar.gz 文件从一个目录移动到另一个目录

node.js - 有没有办法阻止 PR 在 Jenkins 构建完成之前被 merge

git - 将更改推送到原点(上游)后如何将更改推送到另一个 Remote ?

javascript - 用于授权回调的 Travis CI 的 URL 是什么。生成 Github token

github - 尝试合并分支时执行 Github Action