Ubuntu Git – How to Update to a Newer Version of Git Using Apt-Get

aptgitUbuntuupgrade

I've just set up a new machine with Ubuntu Oneiric 11.10 and then run

apt-get update
apt-get upgrade
apt-get install git

Now if I run git --version it tells me I have git version 1.7.5.4 but on my local machine I have the much newer git version 1.7.9.2

I know I can install from source to get the newest version, but I thought that it was a good idea to use the package manager as much as possible to keep everything standardized.

So is it possible to use apt-get to get a newer version of git, and what is the right way to do it?

Best Answer

You have several options:

  1. Either wait until the version you need is present in the repository you use.
  2. Compile your own version and create a deb.
  3. Find a repository that provides the version you need for your version of your distribution(e.g. Git PPA).
  4. If you don't need any particular feature from the newer version, stay with the old one.

If a newer version is available in the repositories you use, then apt-get update && apt-get upgrade (as root) updates to the latest available version.

For those who don't know what a PPA is, link

Related Question