Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 17 down vote accepted

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 never version is available in the repositories you use, then apt-get update && apt-get upgrade (as root) updates to the latest available version.

share|improve this answer
1  
+1 for the PPA. Otherwise compile from source and use checkinstall to cleanly install a .deb –  Axel Knauf Mar 7 '12 at 15:54
    
Just what I needed. Thank you. –  sshakir May 2 '13 at 5:35

Doing a search for "git ppa" gives Git stable releases. See instructions for installing here. You can also install the package by downloading directly from the web page, and installing with dpkg -i.

share|improve this answer

Here are the commands you need to run, if you just want to get it done:

sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git
git --version

As of Dec 2014, I get git 2.2.0 that way, while the version in the Ubuntu Trusty repositories is 1.9.1.

share|improve this answer
1  
This works, and you posted it in just in time for me. :) –  fg nu Dec 1 at 13:59
    
This looks like the answer I want, but when I run through those steps, I still get my old git install version (1.8.x) on Ubuntu 14.04. –  Steve Midgley Dec 17 at 1:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.