0

Install git from an RPM file

Welcome to post 10 of my 100 day challenge. Checkout my introduction for some background.

This tutorial discusses how to install Git from an RPM file.

Step-by-step guide

If you haven’t already created the Git RPMs please following this tutorial first: Create an RPM package from source

  1. Copy the RPMs to the server so they are available for install:
    scp -r ~/rpmbuild/RPMS/x86_64/. <username>@<server name>:/home/<username>/RPMS
  2. Remove git if it is already installed:
    # If installed via yum:
    sudo yum -y remove git
    # If installed via RPM:
    sudo rpm -ev git
  3. Install dependencies to install Git from an RPM:
    sudo yum -y install subversion-perl perl-YAML
  4. Install the RPMs:
    cd ~/RPMS
    sudo rpm -i git-svn-2.2.2-1.el6.x86_64.rpm perl-Git-2.2.2-1.el6.x86_64.rpm git-2.2.2-1.el6.x86_64.rpm
  5. Check that Git is installed at at the desired version:
    git --version
    git version 2.2.2
  6. Remove the RPMs:
    sudo rm -rf ~/RPMS

Subscribe to my feed either by E-mail or by RSS to receive updates as they happen.

Can you improve on any of the tips I’ve discussed here? If you can let me know in the comments.

Jason Edwards