RHEL 6 – How to Install Git on Red Hat Enterprise Linux 6

epelgitrhel6

I'm trying to install Git on a RHEL6 development server, I have experience with Ubuntu but this is my first time working with RHEL (I'm a developer trying to fill in for a recently departed Linux Sysadmin).

I've set up two additional repos (EPEL and IUS) for other packages needed for a Magento install. Output of yum repolist:

[root@box]# yum repolist
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
repo id              repo name                                        status
epel                 Extra Packages for Enterprise Linux 6 - x86_64   7,841
ius                  IUS for RHEL 6Server - x86_64                    135

Most of what I've read indicates a simple 'yum install git' should work with EPEL enabled, but I get the dreaded

[root@box]# yum install git
Loaded plugins: product-id, security, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
No package git available.
Error: Nothing to do

Same goes for git-daemon, etc.

I've tracked down a number of git RPMs such as this one at repoforge but they require a train of dependencies that seems to never end.

I've also toyed with compiling it manually but the rabbit hole to get make working seems to go even deeper.

I'm convinced there's a simple oversight somewhere keeping me from being able to install from the EPEL repo, but I'm a rookie at all this. Thanks in advance for help/pointers/additional resources.

Best Answer

It's a problem with your YUM repo for the actual distribution... It doesn't appear as though you have a "base" repository, based on your yum repolist command output. I suppose you could just download it as well...

[root@Kitteh ~]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: xt.lol.net
 * epel: mirror.cogentco.com
 * extras: xt.lol.net
 * update: xt.lol.net
repo id                             repo name                                                                 status
base                                CentOS-6 - Base                                                           6346
epel                                Extra Packages for Enterprise Linux 6 - x86_64                            7858
extras                              CentOS-6 - Extras                                                            4
rpmforge                            Red Hat Enterprise 6 - RPMforge.net - dag                                 4445
update                              CentOS-6 - Updates                                                         665

...and proof that GIT is part of the base repository...

[root@Kitteh ~]# yum info git
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: xt.lol.net
 * epel: mirror.cogentco.com
 * extras: xt.lol.net
 * update: xt.lol.net
Installed Packages
Name        : git
Arch        : x86_64
Version     : 1.7.1
Release     : 2.el6_0.1
Size        : 15 M
Repo        : installed
From repo   : anaconda-CentOS-201112091719.x86_64
Summary     : Fast Version Control System
URL         : http://git-scm.com/
License     : GPLv2
Description : Git is a fast, scalable, distributed revision control system with an
            : unusually rich command set that provides both high-level operations
            : and full access to internals.
            : 
            : The git rpm installs the core tools with minimal dependencies.  To
            : install all git packages, including tools for integrating with other
            : SCMs, install the git-all meta-package.