git - 在 CentO 上安装 Git

标签 git

我想在 CentOs 上安装 git,我正在运行这个命令

yum install git-core

但问题是,我收到了这些错误:

Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * epel: mirrors.solfo.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-3.el6_4.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-3.el6_4.1 for package: git-1.7.1-3.e
l6_4.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.7.1-3.el6_4.1.x86_64
--> Processing Dependency: perl(Error) for package: git-1.7.1-3.el6_4.1.x86_64
--> Finished Dependency Resolution
Error: Package: git-1.7.1-3.el6_4.1.x86_64 (updates)
           Requires: perl-Git = 1.7.1-3.el6_4.1
Error: Package: git-1.7.1-3.el6_4.1.x86_64 (updates)
           Requires: perl(Error)
Error: Package: git-1.7.1-3.el6_4.1.x86_64 (updates)
           Requires: perl(Git)
 You could try using --skip-broken to work around the problem
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
frontpage-2002-SR1.2.i386 has missing requires of libexpat.so.0
sendmail-cf-8.14.4-8.el6.noarch has missing requires of sendmail = ('0', '8.14.4
', '8.el6')

我怎样才能解决这个问题?

最佳答案

blog article by lishevita提及:

It turns out, Cpanel blocks installation of any perl packages through yum in order to make sure that nothing interferes with their customized packages.
Pain in the NECK!

The good news is that the perl packages that git needs won't mess with Cpanel, so you can go ahead and install them.
Yum has a spiffy one time option to let you get around the excluded package problem.

yum --disableexcludes=main install git

I searched ALL OVER for this little tidbit, and only found it this post by Nick Andreson.
Hopefully, having this post, and the link back to his post will help improve searches in the future so that you find your answer more easily!! (And thanks, Nick for your post!)

或者你可以使用 cPanel 自带的 git 位于:

root@CentOS-cPanel-box [/]# /usr/local/cpanel/3rdparty/bin/git --version
git version 1.8.3.4

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

相关文章:

git - 添加 -A/commit 主/所有子模块的简单方法

git 存储库在从 linux 中的 jenkins 连接时出现 403 错误

git - 发布补丁队列的 Git 方法是什么?

git - 将许多提交压缩为更少但更大的提交

git - -‌- 在 git checkout 中的含义

git - 总是在 git 上提交所有文件不好吗?

git - 重命名存储库后,GitHub 会记住旧的源 url 吗?

git - 无法丢弃 git 中的更改

java - 如何使用 jgit 库将 git HEAD 指向特定的 ref?

git - VS2022 中的工作树?