Home > Build from Source, Installation, Softwares, System Administration > Installing Git on Ubuntu 10.04 Lucid Lynx (Should Work for 10.10 Maverick Meerkat, too)

Installing Git on Ubuntu 10.04 Lucid Lynx (Should Work for 10.10 Maverick Meerkat, too)

September 27, 2010 Leave a comment Go to comments

In my current job one of the most frequent things I do is to setup/install git for the developers which is very much essential tool for them as per our organization’s development architecture. Previously we built a customized deb package and added that to our local debian and ubuntu repository and the “apt-get install -t local git” used to work for us (the Sys. Admins here). But with the updated versions and increased workload on other sectors somehow that process is now obsolete for us. So now we’ve gone back to that sweet old “build from source file” approach. Here’s how I do that stuff for git 1.7.3🙂

Step 1. Resolve The Dependencies:

$ sudo apt-get install curl libcurl4-openssl-dev libexpat1-dev gettext zlib1g-dev

Step 2. Download, untar and build:

$ wget http://kernel.org/pub/software/scm/git/git-1.7.3.tar.gz

$ tar -zxvf git-1.7.3.tar.gz

$ cd git-1.7.3

$ ./configure –prefix=/usr/local/git

$ make

$ sudo make install

Step 3. Check & Confirm Installation:

$ /usr/local/git/bin/git –version

** Errors You May Find During Installation:

Error Type 1:

* tclsh failed; using unoptimized loading
MSGFMT    po/de.msg make[1]: *** [po/de.msg] Error 127
make: *** [all] Error 2

Solution:

$ sudo apt-get install gettext

Error Type 2:

CC fast-import.o
In file included from builtin.h:6,
from fast-import.c:147:
cache.h:17:18: error: zlib.h: No such file or directory
In file included from builtin.h:6,
from fast-import.c:147:
cache.h:22: error: expected ‘)’ before ‘strm’
cache.h:23: error: expected ‘)’ before ‘strm’
cache.h:24: error: expected ‘)’ before ‘strm’
fast-import.c:285: error: ‘Z_DEFAULT_COMPRESSION’ undeclared here (not in a function)
fast-import.c: In function ‘store_object’:
fast-import.c:996: error: ‘z_stream’ undeclared (first use in this function)
fast-import.c:996: error: (Each undeclared identifier is reported only once
fast-import.c:996: error: for each function it appears in.)
fast-import.c:996: error: expected ‘;’ before ‘s’
fast-import.c:1028: error: ‘s’ undeclared (first use in this function)
fast-import.c:1039: error: ‘Z_FINISH’ undeclared (first use in this function)
fast-import.c:1039: error: ‘Z_OK’ undeclared (first use in this function)
fast-import.c: In function ‘stream_blob’:
fast-import.c:1142: error: ‘z_stream’ undeclared (first use in this function)
fast-import.c:1142: error: expected ‘;’ before ‘s’
fast-import.c:1143: error: ‘Z_OK’ undeclared (first use in this function)
fast-import.c:1165: error: ‘s’ undeclared (first use in this function)
fast-import.c:1175: error: ‘Z_STREAM_END’ undeclared (first use in this function)
fast-import.c:1188: error: ‘Z_FINISH’ undeclared (first use in this function)
fast-import.c:1200: error: ‘Z_BUF_ERROR’ undeclared (first use in this function)
fast-import.c: In function ‘git_pack_config’:
fast-import.c:2846: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function)
make: *** [fast-import.o] Error 1

CC fast-import.oIn file included from builtin.h:6,from fast-import.c:147:cache.h:17:18: error: zlib.h: No such file or directoryIn file included from builtin.h:6,from fast-import.c:147:cache.h:22: error: expected ‘)’ before ‘strm’cache.h:23: error: expected ‘)’ before ‘strm’cache.h:24: error: expected ‘)’ before ‘strm’fast-import.c:285: error: ‘Z_DEFAULT_COMPRESSION’ undeclared here (not in a function)fast-import.c: In function ‘store_object’:fast-import.c:996: error: ‘z_stream’ undeclared (first use in this function)fast-import.c:996: error: (Each undeclared identifier is reported only oncefast-import.c:996: error: for each function it appears in.)fast-import.c:996: error: expected ‘;’ before ‘s’fast-import.c:1028: error: ‘s’ undeclared (first use in this function)fast-import.c:1039: error: ‘Z_FINISH’ undeclared (first use in this function)fast-import.c:1039: error: ‘Z_OK’ undeclared (first use in this function)fast-import.c: In function ‘stream_blob’:fast-import.c:1142: error: ‘z_stream’ undeclared (first use in this function)fast-import.c:1142: error: expected ‘;’ before ‘s’fast-import.c:1143: error: ‘Z_OK’ undeclared (first use in this function)fast-import.c:1165: error: ‘s’ undeclared (first use in this function)fast-import.c:1175: error: ‘Z_STREAM_END’ undeclared (first use in this function)fast-import.c:1188: error: ‘Z_FINISH’ undeclared (first use in this function)fast-import.c:1200: error: ‘Z_BUF_ERROR’ undeclared (first use in this function)fast-import.c: In function ‘git_pack_config’:fast-import.c:2846: error: ‘Z_BEST_COMPRESSION’ undeclared (first use in this function)make: *** [fast-import.o] Error 1

 

Solution:

$ sudo apt-get install zlib1g-dev

Now that should do for your Git installation🙂


  1. November 25, 2010 at 5:42 am

    This just happend to me on a fresh debian install. Thanks a ton! Solution worked perfectly.

    • November 25, 2010 at 10:35 am

      glad to hear that man🙂

  2. jay
    March 24, 2011 at 12:33 am

    Hi,
    Interesting to see your struggle through revolutions.
    I hope you the best.
    I myself is a struggler and a winner too.
    The article helped me in getting through the git in Ubuntu.
    Jay

  3. March 29, 2011 at 9:44 pm

    thanks dude … that’s my pleasure🙂

  4. April 5, 2013 at 2:32 am

    Thanks a bunch – the MSGFMT / gettext solution was helpful!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: