Linux – How to install git on a CentOS system without an internet connection

centosgitlinux

I need to install git on a CentOS 5.6 64-bit system, but I do not have an internet connection, so I can't simply download it through yum. Also, I do not have gcc installed, so I cannot build it from source, unless gcc can be installed without a connection as well.

I have searched for an RPM that I can download and transfer via flash drive, but I haven't been able to find one. If anyone has any suggestions, it would be much appreciated.

EDIT

As per qweet's instructions, I downloaded the rpms and attempted to install them, but got the errors below:

$ sudo rpm -i perl-5.8.8-32.el5_6.3.x86_64.rpm

warning: perl-5.8.8-32.el5_6.3.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
    file /usr/bin/a2p from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/bin/perl from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/bin/perl5.8.8 from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/lib/perl5/5.8.8/CGI.pm from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/config.h from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/libperl.so from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/sperl.o from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    file /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/Config_heavy.pl from install of perl-5.8.8-32.el5_6.3.x86_64 conflicts with file from package perl-5.8.8-32.el5_5.2.x86_64
    #...
    #There are a bunch more files, but a 30k character limit on these posts.  All the files say the same thing.

$ sudo rpm -i perl-Git-1.7.4.1-1.el5.x86_64.rpm

warning: perl-Git-1.7.4.1-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
error: Failed dependencies:
    git = 1.7.4.1-1.el5 is needed by perl-Git-1.7.4.1-1.el5.x86_64
    perl(Error) is needed by perl-Git-1.7.4.1-1.el5.x86_64

$ sudo rpm -i git-1.7.4.1-1.el5.x86_64.rpm

warning: git-1.7.4.1-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
error: Failed dependencies:
    perl(Error) is needed by git-1.7.4.1-1.el5.x86_64
    perl(Git) is needed by git-1.7.4.1-1.el5.x86_64
    perl-Git = 1.7.4.1-1.el5 is needed by git-1.7.4.1-1.el5.x86_64

Best Answer

Well, since Git is part of the EPEL repository, your only hope is to go and download it through Yum, or by traversing the repos.

Luckily for you...

x86_64 /cent5

git.x86_64.rpm

perl_git.x86_64.rpm (dep)

perl.x86_64 (dep)

i386 /cent5

git.i386.rpm

perl_git.i386.rpm (dep)

perl.i386 (dep)

x86_64 /cent6

git.x86_64.rpm

perl_git.x86_64.rpm (dep)

perl.x86_64 (dep)

i386 /cent6

git.i386.rpm

perl_git.i386.rpm (dep)

perl.i386

Install perl_git first, then install git. You can do this either through Yum or by RPM. If you need Perl, just comment and I'll get an RPM for you.