Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

If I run the following command on Debian Lenny:

apt-get install git

... I'm unable to use git:

# git --version
bash: git: command not found
share|improve this question
add comment

2 Answers 2

up vote 11 down vote accepted

The package you most likely want is git-core.

(Works just fine without adding an extra repository.)

Update: This has now been fixed; in squeeze and beyond the git package is now called git.

share|improve this answer
    
Aha, that's a much easier approach. Thanks. I'm surprised that the Debian site didn't make this more clear. Oh well, that's Debian for you I guess. –  nbolton Jul 4 '10 at 12:08
    
However, with this approach you only get git version 1.5.6.5 –  nbolton Jul 4 '10 at 15:31
    
Yes, that seems to be the version of the dvcs git being provided in lenny. So if you really need/want a newer version, there is still a benefit in going for the backports. –  andol Jul 4 '10 at 15:45
    
Will still mark yours as the valid answer, since it's less complicated! ;-) –  nbolton Jul 4 '10 at 16:27
add comment

To get ~1.7.1 use this method. If you want ~1.5.6.5 then use andol's answer.

This is because git is a dummy package in Lenny which provides gnuit.

However, you can get around this by using the lenny-backports git package:

UPDATE: As of September 5th 2010, this method has changed slightly as backports.org is being phased out the instructions now follow the recommended solution to install from the latest Debian backports.

  1. Add this line:

    deb http://archive.debian.org/debian-backports/ lenny-backports main contrib non-free
    

    to your /etc/apt/sources.list.

  2. Run: apt-get update.
    If you get get a security warning about NO_PUBKEY AED4B06F473041FA, run step 3, 4 and 5 -- if not, skip to step 6.

    Run: gpg --keyserver pgp.mit.edu --recv-keys AED4B06F473041FA

    Run: gpg --armor --export AED4B06F473041FA| apt-key add -

    Run: apt-get update again to confirm.

    Note, adding the debian-backport-keyring is no longer necessary.

  3. Run: apt-get -t lenny-backports install git

  4. Run: git --version

    git version 1.7.2.3
    
share|improve this answer
    
When executing the 2nd gpg line, I got "gpg: can't open `/etc/apt/trusted.gpg'" and then an error. I fixed this by su'ing instead of sudo'ing. Then apt-get -t lenny-backports install git persists in claiming that 1.5.6.5 is the latest version of git. I fixed this by replacing your recommended sources.list line with deb archive.debian.org/debian-backports lenny-backports main contrib non-free. Then all was well. Don't want to edit your answer, because I don't actually know what I'm doing. Just thought I'd share what worked for me. –  acjay Sep 7 '12 at 9:47
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.