Installing Git on Ubuntu
I watched Scott’s great screencast on Git and figured I should make use of the old server that I have sitting around. Unfortunately, my install didn’t go as smoothly as Scott’s, mostly because the Ubuntu server edition has a few less libraries than the developer edition. So to make things a little smoother for others here are the libraries that I had to install.
sudo apt-get install build-essential tcl8.4 tk8.4 gettext
# expat wget http://superb-west.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz tar zxfv expat-2.0.1.tar.gz cd expat-2.0.1 ./configure make make install
# curl wget http://curl.linux-mirror.org/download/curl-7.18.0.tar.gz tar zxfv curl-7.18.0.tar.gz cd curl-7.18.0/ ./configure make prefix=/usr all make prefix=/usr all install
# zlib wget http://www.zlib.net/zlib-1.2.3.tar.gz tar -xzvf zlib-1.2.3.tar.gz cd zlib-1.2.3/ ./configure make sudo make install
# openssl wget http://www.openssl.org/source/openssl-0.9.8c.tar.gz tar -xzvf openssl-0.9.8c.tar.gz cd openssl-0.9.8c/ ./config --prefix=/usr/local/ssl-0.9.8c shared zlib-dynamic enable-camellia make depend make sudo make install
Now you should be able to install git
# git wget http://kernel.org/pub/software/scm/git/git-1.5.4.4.tar.gz tar -xzvf git-1.5.4.4.tar.gz cd git-1.5.4.4/ make MOZILLA_SHA1=1 prefix=/usr all sudo make MOZILLA_SHA1=1 prefix=/usr install
The steps above may not be perfect as I posted them after retracing my steps after a successful install. My fingers are crossed.
** Update:
Thanks to Sascha for pointing out the — double dash issue. That’s what I get for being too lazy to enclose the script within pre tags.
Hopefully this saves someone a little time.
Trackbacks
Trackbacks are closed.

Thanks for the instructions. I found a typo. You are missing a dash on the openssl configure. Should be –prefix instead of -prefix.
Wordpress seems to remove the double dash out of the comment. Should be double dash in front of prefix.
Thanks - only thing that I had to change was a `sudo make install` for expat. (it’s seems FF has the desired OpenSSL version so I didn’t need to install that) Seriously, I’d say it was perfect! I really appreciate the install guidelines. Thanks Chris
hehe just realized you’re configuring open-ssl with zlib/etc - so I went ahead and did that. Sasha - I believe it’s a long-dash in the post, which is how wordpress (and other word processing apps) will infer double dash. It’s sort of annoying until you see it a few times.
Thanks again Chris!
Sorry about the double dash issue. I will look for a way around this for later posts.
Glad to see it has helped someone else out.
Thanks for this, worked great!
Thanks, installed it in Hardy Heron and everything works fine!
Thanks, these instructions really helped me lots!
Even if you compile git from source (to get the latest), it is still wise to install as many of those other libraries as possible using “apt-get install ___”. This is faster, easier, will get future upgrades to the libraries automatically, and will make them available to other packages that need them.
It’s also a good idea to use checkinstall for installing git from source. This creates a ubuntu-package (deb) which can be easily removed from your system.
Chris, thanks so much for the great post! Just a thought: you might want to update this post to include installing the git documentation. Thanks again!