9

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
Nick Bolton
  • 5,016
  • 12
  • 51
  • 62

2 Answers2

12

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.

sleske
  • 9,851
  • 4
  • 33
  • 44
andol
  • 6,848
  • 28
  • 43
  • 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. – Nick Bolton Jul 04 '10 at 12:08
  • However, with this approach you only get git version 1.5.6.5 – Nick Bolton Jul 04 '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 04 '10 at 15:45
  • Will still mark yours as the valid answer, since it's less complicated! ;-) – Nick Bolton Jul 04 '10 at 16:27
5

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
    
Zulakis
  • 4,191
  • 14
  • 44
  • 75
Nick Bolton
  • 5,016
  • 12
  • 51
  • 62
  • 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 http://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 07 '12 at 09:47