30

How can I configure yum to use some repository which has git rpms?

BuyManAFish
  • 423
  • 1
  • 4
  • 7

5 Answers5

41

Use the EPEL (Extra Packages for Enterprise Linux) repository. The easiest way to enable it is by installing the epel-release package. Here's how if you have RHEL 5 x86_64:

[root@localhost]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
[root@localhost]# yum install git
Cristian Ciupitu
  • 6,226
  • 2
  • 41
  • 55
  • 2
    I would make sure to install a 64-bit version of git if you're really using a 64-bit system because git is a heavy user of mmap() and loves to have a large address space if the project's getting bigger (during repacking, etc). – knweiss Nov 04 '09 at 20:54
  • Following Cristian's directions, he will get 64-bit if he is on 64-bit architecture. – James May 16 '11 at 17:41
  • If I run `$ rpm -Uvh http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm` I get `error: skipping http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm - transfer failed - Unknown or unexpected error warning: u 0x1db4cfe0 ctrl 0x1db501a0 nrefs != 0 (download.fedoraproject.org http)` – highBandWidth Oct 12 '12 at 01:12
  • @highBandWidth: your mirror might have some issues. Try to download `epel-release` manually by following the instructions from the EPEL page. – Cristian Ciupitu Oct 12 '12 at 10:45
  • 1
    It seems now you need to do `dl.fedoraproject.org`. – highBandWidth Oct 12 '12 at 15:15
  • I've heard that the `rpm` command from RHEL5 doesn't know about http redirects (to mirrors), so you should use either the direct download link (`dl.fed...`) or download the RPM file using another program, e.g. wget, curl, etc. and then install it. – Cristian Ciupitu Oct 12 '12 at 17:31
  • It's not resolving dependencies automatically, i am seeing this error *Missing Dependency: perl(Git) is needed by package git-1.7.4.1-1.el5.x86_64 (epel)* – ish1301 Jan 16 '13 at 20:07
  • @IshKumar: maybe your mirror is not up to date, so wait a couple of days and try again. Or report the issue as recommended [here](http://fedoraproject.org/wiki/EPEL/FAQ#Where_can_I_find_help_or_report_issues.3F). – Cristian Ciupitu Jan 18 '13 at 12:22
5

For a more up-to-date version of Git (1.7.2.3 at the time of this writing versus 1.5.5.6 in the EPEL repository), see Andrew Thompson's Webtatic repository:

http://www.webtatic.com/blog/2009/09/git-on-centos-5/

MHosafy
  • 3
  • 3
Adam Franco
  • 261
  • 2
  • 8
0

i Suggest you can download the source from offical webpage and to do configure & make & make install instead of use yum. :D

final
  • 27
  • Why? People like the tracking features of using an RPM, is there some other benefit of compiling yourself? – Ken Williams Jul 16 '14 at 14:28
  • Because (make, make install) is the same for every linux System, while the RPMs aren't and have to be changed for every distribution (rhel, ubuntut ....) – eactor Jul 26 '17 at 08:48
0

Elaborating @Cristian Ciupitu answer it would be possible to do it via yum.repos.d:

  1. Go to https://fedoraproject.org/keys and install the RPM-GPG-KEY-EPEL public key by downloading its contents into the RPM-GPG-KEY-EPEL file and running rpm --import RPM-GPG-KEY-EPEL.

  2. Create a file rhel-epel.repo (choose any name you want) in /etc/yum.repos.d/

  3. Add following content:

    [rhel-epel]
    name=Extra Packages for Enterprise Linux $releasever - $basearch
    baseurl=http://download3.fedora.redhat.com/pub/epel/$releasever/$basearch
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
    
  4. run yum install git.

-3

one way i feel it should work /etc/yum.repos.d/same.repo if you give git locate where your looking git packages

Rajat
  • 3,329
  • 21
  • 29