I have a RHEL 6.4 VM provisioned by my company's internal KVM.
We are having some trouble using yum (Cannot retrieve repository metadata, which I've confirmed in this case is peculiar to my company's internal cloud), so I have to build Git from source.
Downloading the RPM file and issuing
sudo yum localinstall ....rpm
Gives me the same Cannot retrieve repository metadata error.
Issuing
sudo rpm -ivh ....rpm
Fails with an error: Failed dependencies and then lists all the packages I need to install. I assume I could find the download links for all of them, but I've tried this before and was unable to find the download links for the right versions for the right packages.
The following code actually works, thanks to @slm's answer:
wget ftp://fr2.rpmfind.net/linux/dag/redhat/el6/en/x86_64/extras/RPMS/perl-Git-1.7.9.6-1.el6.rfx.x86_64.rpm
wget http://pkgs.repoforge.org/git/git-1.7.9.6-1.el6.rfx.x86_64.rpm
rpm -ivh perl-Git-1.7.9.6-1.el6.rfx.x86_64.rpm git-1.7.9.6-1.el6.rfx.x86_64.rpm
If I just download the git code, untar it, and build it, like:
wget https://www.kernel.org/pub/software/scm/git/git-1.8.5.tar.gz
tar -xvf git-1.8.5.tar.gz
cd git-1.8.5
./configure
make
make install
I receive the following error when cloning from the http:// protocol:
fatal: Unable to find remote helper for 'http'
Googling told me that I needed curl-devel and expat. I can not use yum, so I went and built those as well:
cd ..
wget http://curl.haxx.se/download/curl-7.34.0.tar.gz
tar -xvf curl-7.34.0.tar.gz
cd curl-7.34.0
./configure
make
make install
cd ..
wget http://downloads.sourceforge.net/expat/expat-2.1.0.tar.gz
tar expat-2.1.0.tar.gz
cd expat-2.1.0
./configure
make
make install
However, upon rebuilding Git, I receive the same error. After Googling more I determined that I needed to pass the following parameters to Git's ./configure:
cd git-1.8.5
./configure --with-curl=<curl_install_path> --with-expat=<expat_install_path>
However, I couldn't determine where the curl and expat install paths were located.
So what I did instead was build Git, curl, and expat using the ./configure --prefix=/path/to/desired/install/path
mkdir curl
cd curl-7.34.0
./configure --prefix=/home/downloads/curl
...
mkdir expat
cd expat-2.1.0
./configure --prefix=/home/downloads/expat
...
mkdir git
cd git-1.8.5
./configure --prefix=/home/downloads/git --with-curl=/home/downloads/curl --with-expat=/home/downloads/expat
...
and from this I was able to clone with Git from the http protocol. However, this violates the Linux file structure.
Two Questions:
- When building Git from source, you need to include the curl and expat install paths to
./configure. Where are these install paths when installing curl and expat without theprefixargument? - I learned that I needed curl and expat's install paths when I got an error and searched for it. Are there any other programs I need to tell Git so I don't get errors in the future?