Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have Git version 1.5.4.3 installed, but I think this must be an old version. I'm running Ubuntu Hardy 8.04. I need to install at least version 1.6 to get a Git GUI to work. How do I upgrade my installation?

Update: I managed to upgrade my installation of Git, but I also realized that my version of Ubuntu was old so I upgraded to the newest version, which automatically gave me access to newer packages (including Git).

share|improve this question

migrated from stackoverflow.com Oct 16 '09 at 13:15

This question came from our site for professional and enthusiast programmers.

    
Which ubuntu version? –  tonfa Oct 14 '09 at 22:36
    
This is already answered on Superuser superuser.com/questions/55542/how-to-upgrade-git-on-ubuntu –  gnibbler Oct 15 '09 at 0:14
add comment

10 Answers 10

up vote 23 down vote accepted

I used the PPA for Ubuntu Git Maintainers to update Git from 1.5.4.3 on Hardy to 1.6.5.2. No compiling, just add another entry to your sources list, apt-get update and you're good to go.

https://launchpad.net/~git-core/+archive/ppa

More info on the page (Technical details > Read about installing).

Or just run:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git
share|improve this answer
    
What is the point of the python-software-properties install? –  James McMahon Oct 26 '12 at 17:39
    
Quite honestly, I don't know anymore since this answer is 3 years old... probably the package is needed to install git. You can try installing without it, if it's needed, apt-get will complain. –  Manuel Meurer Oct 28 '12 at 20:11
    
I thought add-apt-repository was introduced in karmic (9.10) help.ubuntu.com/community/Repositories/CommandLine –  rakslice Nov 16 '12 at 4:03
    
I do not know how you managed to use add-apt-repository on hardy, but it didn't work on my 8.04 server even after a complete update. So I am publishing my own instructions, just in case someone found the same problem. –  Fran Mar 7 '13 at 16:45
    
See my comment on your answer for a tip on how to get add-apt-repository working. –  Manuel Meurer Mar 8 '13 at 9:50
add comment

To update git to newer version in ubuntu

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

i am using ubuntu 10.04.2 Lucid

share|improve this answer
    
Awesome, this should be the merged with the correct answer (IMHO) because it uses the distribution tools that are in place for exactly this purpose. –  vdboor May 10 '12 at 14:00
4  
Might need to sudo apt-get install python-software-properties first if add-apt-repository doesn't work. –  Leopd Jul 30 '12 at 22:54
add comment

This tutorial worked great for me. Here's what you should do:

Download the newest version from the Git website to your home directory and extract it.

Open up the terminal and enter the following commands (one at a time):

sudo apt-get remove git git-svn
sudo apt-get build-dep git-core
cd git-1.6.5/ (or whatever version you downloaded and extracted)
./configure
make
sudo make install

You should now have the newest version of Git installed.

share|improve this answer
2  
..and it's installed bypassing the packet management, so you are on your own with future updates. Not to say it's all bad - I just prefer installing packages over compiling whenever I can. –  Jawa Nov 10 '09 at 8:50
    
Now it's better just to clone and fetch the latest from github: github.com/git/git.git. Checkout the tag with the latest version. –  adymitruk Nov 3 '11 at 18:20
1  
This is totally not needed. The package manager has an official way to introduce new versions in the system. This is just hacking around it. –  vdboor May 10 '12 at 13:59
add comment
$ sudo apt-get update
$ sudo apt-get install git-core

Which ubuntu are you on? Hardy is still on version 1.5.4.3 for example. You may be able to install the version from one of the newer releases of ubuntu though

share|improve this answer
    
I think I'm on Hardy since I am still on version 1.5.4.3 –  Andrew Oct 14 '09 at 23:42
    
I was able to install a newer version of Git on Hardy by doing it manually. Is that ok? Or is there a reason Hardy is still on version 1.5.4.3? –  Andrew Nov 10 '09 at 18:47
add comment

Git 1.6 is available starting with Jaunty: https://launchpad.net/ubuntu/+source/git-core

So if you don't want to compile/install the package yourself, you'll need to upgrade your system to a newer ubuntu version.

share|improve this answer
add comment

I did this on Hardy with the following commands:

wget http://www.backports.org/debian/pool/main/g/git-core/git-core_1.6.3.3-1~bpo50+1_i386.deb
sudo dpkg -i git-core_1.6.3.3-1~bpo50+1_i386.deb

If somebody knows some reason not to do it this way, please comment.

share|improve this answer
    
This is interesting. Why use backports? Does this automatically keep the package updated? –  Andrew Nov 10 '09 at 18:53
3  
One reason not to do it that way is because you're not using Debian. Another reason not to do it that way is because you shouldn't be manually running "dpkg -i". If you want a backport, go through the backport request process for Ubuntu: help.ubuntu.com/community/UbuntuBackports –  jamessan Nov 10 '09 at 19:01
add comment

All packadges can be found at https://launchpad.net/ubuntu/+source/git-core

cd /tmp    
sudo apt-get install liberror-perl libdigest-sha1-perl
wget --no-check-certificate https://launchpad.net/ubuntu/+archive/primary/+files/git-core_1.7.0.4-1_amd64.deb
sudo dpkg -i git-core_1.7.0.4-1_amd64.deb
share|improve this answer
add comment

First thing, try running the software update utility and see if it's got a new version for you. Alternatively, as root,

apt-get update && apt-get upgrade

If that fails, you could try finding a backported version of git such as this one

If that for whatever reason does not work for you, you could download the source files from the git webpage. Ensure you have build-essential installed ---

apt-get install build-essential

and then if it is anything like any other reasonable package,

./configure --prefix=/usr/local && make && sudo make install
share|improve this answer
1  
don't use make install. Use checkinstall. It turns the result of your make install into a deb file that allows the package manager to track the installation. –  Ryan Thompson Nov 13 '09 at 2:29
add comment

Why would you ever want to do this?

sudo apt-get build-dep git-core

on a newly installed Karmic tries to install 560MB/137 packages

https://launchpad.net/~git-core/+archive/ppa is the way to go specially for ease of updates.

share|improve this answer
add comment

The answer from @Manuel Meurer was good, but it didn't work for me since my updated Ubuntu 8.04 "Hardy" has no add-apt-repository command, and it seems to not exist in no package.

So, these are my own instructions just in case someone founds the same problem:

Create a file called 'git.list' within /etc/apt/sources.list.d/ with the following content:

    deb http://ppa.launchpad.net/git-core/ppa/ubuntu hardy main 
    deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu hardy main

Then exec:

    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24

And then:

    sudo apt-get update
    sudo apt-get install git

If you notice dependency problems during the install, then try this before the previous apt-get commands:

    sudo apt-get purge git git-core
share|improve this answer
    
Try this to get add-apt-repository working: sudo apt-get install --reinstall python-software-properties && sudo dpkg-reconfigure python-software-properties –  Manuel Meurer Mar 8 '13 at 6:33
add comment

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.