Sign up ×
Server Fault is a question and answer site for 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

2 Answers 2

up vote 12 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 – 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

To get ~1.7.1 use this method. If you want ~ 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 is being phased out the instructions now follow the recommended solution to install from the latest Debian backports.

  1. Add this line:

    deb 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 --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
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 is the latest version of git. I fixed this by replacing your recommended sources.list line with deb 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

Your Answer


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.