Installing git on Oracle Linux 5 (or install git from source)

In this post I’ll tell you how to install git onto Oracle Linux. It’s a standard install from source. But since I always have to lookup how this is done – I’ll drop it here for future reference.

For those of you who don’t like installs from source: don’t worry – it’s easy.

edit: I’ve found an easier way. Described here

I fell in love with “git” a while ago. I like the local commit option, the branching. The complete control you have on what is committed and when.

And most of all: I like the fact that git considers a checkout repository as a whole. Git will tell you if you have uncommitted files “hanging around” in a directory under it’s control. Even if your “git status” command is run deep inside the source-tree. You will get a full list of all files that need attention. Even files in parent and “cousin” directories. I love that!

Oh and git will play nice with subversion. Meaning: you can use git to check-in and out of a subversion repository.

Ok, back the installing.

No yum support *sigh*
I’m not sure why, but Oracle does not support yum install of git. So running

yum install git

on Oracle Linux get’s no result (unless you count “No package git available” as a result).

There are no rpms available either. So off we go doing an installation from source. I’m happy to report that it’s no problem what so ever.

Here’s the procedure :

  • Install the dependencies – this can be done with YUM
  • Download the source-code and unpack it
  • Compile and install the compiled programs

You can find the source packages here. (Remember to click on the version you want – the link in the list is not a download-link). I picked up git version 1.7.10.1 and decided to install git in “/usr/local”

Here we go:

Install dependencies:
# yum install curl-devel expat-devel gettext-devel \
openssl-devel zlib-devel

Download a git version and unpack it
# wget http://git-core.googlecode.com/files/git-1.7.10.1.tar.gz
# tar -xvzf git-1.7.10.1.tar.gz
# cd git-1.7.10.1

Compile and install the compiled programs
# make prefix=/usr/local all
# make prefix=/usr/local install

Now leave root and log-in with a standard user:
$ git --version
git version 1.7.10.1

This entry was posted in Software development and tagged , . Bookmark the permalink.

9 Responses to Installing git on Oracle Linux 5 (or install git from source)

  1. John Casey says:

    Thanks for posting. This did the trick!

  2. Ralph Navarro says:

    Works like a charm. Saved me time having workable instructions. Thank you!

  3. Michael Konrad says:

    Fantastic. Thank you!

  4. Thanks for posting this!

  5. urgering says:

    thanks, helped me too, working on an oracle virtualbox

  6. Pingback: How to install Git on Oracle Linux | Engineered 4 Exalogic

  7. Sainath says:

    Thank you for the guide!.. simple and easy flow, saved time :)..
    Cheers..

Leave a Reply