Installing Git on a Debian Lenny server

dmmd picture dmmd · Apr 12, 2012 · Viewed 13k times · Source

Sorry in advance if there's already an answer for this somewhere in the world, but I'm already 3h trying to install this in my PRODUCTION server, and I'm not getting anywhere.

My needs:


I want to run git commands (eg.: push, commit, etc) on my server. In order to do that, I need the "git" command (duh!).

What I tried:


Tried to follow this: http://oli.zilla.org.uk/2010/12/07/installing-git-on-debian-lenny.html

And this: Git for beginners: The definitive practical guide

And this: Installing Rails Plugin Requires Git?

Tried to download the source (http://packages.debian.org/lenny/i386/git-core/download), the .deb file (http://ftp.de.debian.org/debian/pool/main/g/git/)

Problems:


404 when trying to get the source: http://packages.debian.org/lenny/i386/git-core/download

All the repositories I've tried to use gave me a 404 when downloading the packages

Need to update the libc6 from 2.7 to 2.9 in order to install the git-1.7.9 as seen in:

stewie:/tmp# dpkg -i git_1.7.9-1~bpo60+1_i386.deb 
Selecting previously deselected package git.
(Reading database ... 20477 files and directories currently installed.)
Unpacking git (from git_1.7.9-1~bpo60+1_i386.deb) ...
dpkg: dependency problems prevent configuration of git:
 git depends on libc6 (>= 2.9); however:
  Version of libc6 on system is 2.7-18lenny7.
 git depends on libcurl3-gnutls (>= 7.16.2-1); however:
  Package libcurl3-gnutls is not installed.
 git depends on libexpat1 (>= 1.95.8); however:
  Package libexpat1 is not installed.
 git depends on liberror-perl; however:
  Package liberror-perl is not installed.
 git depends on git-man (>> 1:1.7.9); however:
  Package git-man is not installed.
 git depends on git-man (<< 1:1.7.9-.); however:
  Package git-man is not installed.
dpkg: error processing git (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 git

but couldn't find the 2.9 for Debian lenny


Final question:

How do I install git on my Debian 5 (lenny) ?


Tries

Tried @sarnold solution, but (more 404s): http://justpaste.it/w5s



Solution:

Used @sarnold's comment (in his own answer)!

Ah. Lenny has been removed from the mirrors. You need to edit your sources.list to use archive.debian.org instead -- for all your package lines, not just this new one. Please consider upgrading this system to a supported release.

How to:

Edit the contents of /etc/apt/sources.list:

nano /etc/apt/sources.list

Add the following:

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

deb http://archive.debian.org/debian-security/ lenny/updates main non-free contrib
deb-src http://archive.debian.org/debian-security/ lenny/updates main non-free contrib

Update apt-get cache:

apt-get update

Install git:

apt-get install git-core

Done! :)

Late edit:

For some reason, it seems that the Deutsch mirror still valid. Just add

deb http://ftp.de.debian.org/debian-archive/debian/ lenny main
deb-src http://ftp.de.debian.org/debian-archive/debian/ lenny main 

to your sources.list and try to get the package.

Or, of course, try the Debian backports:

deb http://backports.debian.org/debian-backports squeeze-backports main

Answer

djhaskin987 picture djhaskin987 · Apr 12, 2012
  1. Install the debian backports repository (it won't update from there unless you explicitly ask it to):

    # echo 'deb http://backports.debian.org/debian-backports lenny-backports main'\
           >> /etc/apt/sources.list
    
  2. Install git:

    apt-get -t lenny-backports install git-core
    

where the -t lenny-backports tells it explicitly to look for git in backports.

See this site.

Also, the above directions were edited and really taken from the directions for squeeze backports, although I believe they work. I don't know if this is an option on a production server, but I guess Debian is not providing much support for lenny anymore, according to this:

lenny backports discontinued

Following the normal Debian Archive lenny-backports is now discontinued. That means that no upload will be possible anymore and lenny-backports(-sloppy) get moved to archive.debian.org. If you haven't updated yet - now is the time to move to squeeze.

Some numbers about lenny-backports and lenny-backports-sloppy:

Source packages: lenny-backports: 667 - sloppy: 21
Uploads: lenny-backports: 1445 - sloppy: 51
Contributors: lenny-backports: 146 - sloppy: 17

Without all those contributors lenny-backports wouldn't have been possible. Thank you very much for your support! Posted Sun Mar 25 09:07:14 2012