title: Installing Git on a Debian Lenny server
body: <p><em>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.</em></p>
  
  <p><strong>My needs:</strong></p>
  
  <hr>
  
  <p>I  want to run git commands (eg.: push, commit, etc) on my server. In order to do that, I need the "git" command (duh!).</p>
  
  <p><strong>What I tried:</strong></p>
  
  <hr>
  
  <p>Tried to follow this: <a href="http://oli.zilla.org.uk/2010/12/07/installing-git-on-debian-lenny.html" rel="nofollow noreferrer">http://oli.zilla.org.uk/2010/12/07/installing-git-on-debian-lenny.html</a></p>
  
  <p>And this: <a href="https://stackoverflow.com/questions/315911/git-for-beginners-the-definitive-practical-guide#323764">Git for beginners: The definitive practical guide</a></p>
  
  <p>And this: <a href="https://stackoverflow.com/questions/1414454/installing-rails-plugin-requires-git">Installing Rails Plugin Requires Git?</a></p>
  
  <p>Tried to download the source (<a href="http://packages.debian.org/lenny/i386/git-core/download" rel="nofollow noreferrer">http://packages.debian.org/lenny/i386/git-core/download</a>), the .deb file (<a href="http://ftp.de.debian.org/debian/pool/main/g/git/" rel="nofollow noreferrer">http://ftp.de.debian.org/debian/pool/main/g/git/</a>)</p>
  
  <p><strong>Problems:</strong></p>
  
  <hr>
  
  <p>404 when trying to get the source: <a href="http://packages.debian.org/lenny/i386/git-core/download" rel="nofollow noreferrer">http://packages.debian.org/lenny/i386/git-core/download</a></p>
  
  <p>All the repositories I've tried to use gave me a 404 when downloading the packages</p>
  
  <p>Need to update the libc6 from 2.7 to 2.9 in order to install the git-1.7.9 as seen in:</p>
  
  <pre><code>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 (&gt;= 2.9); however:
    Version of libc6 on system is 2.7-18lenny7.
   git depends on libcurl3-gnutls (&gt;= 7.16.2-1); however:
    Package libcurl3-gnutls is not installed.
   git depends on libexpat1 (&gt;= 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 (&gt;&gt; 1:1.7.9); however:
    Package git-man is not installed.
   git depends on git-man (&lt;&lt; 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
  </code></pre>
  
  <p>but couldn't find the 2.9 for Debian lenny</p>
  
  <hr>
  
  <p><strong>Final question:</strong></p>
  
  <p><strong>How do I install git on my Debian 5 (lenny) ?</strong></p>
  
  <hr>
  
  <p><strong>Tries</strong></p>
  
  <p>Tried @sarnold solution, but (more 404s): <a href="http://justpaste.it/w5s" rel="nofollow noreferrer">http://justpaste.it/w5s</a></p>
  
  <hr>
  
  <hr>
  
  <p><strong>Solution:</strong></p>
  
  <p>Used @sarnold's comment (in his own answer)!</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>How to:</p>
  
  <p>Edit the contents of <code>/etc/apt/sources.list</code>:</p>
  
  <pre><code>nano /etc/apt/sources.list
  </code></pre>
  
  <p>Add the following:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Update apt-get cache:</p>
  
  <pre><code>apt-get update
  </code></pre>
  
  <p>Install git:</p>
  
  <pre><code>apt-get install git-core
  </code></pre>
  
  <p>Done! :)</p>
  
  <p><em>Late edit:</em></p>
  
  <p>For some reason, it seems that the Deutsch mirror still valid. Just add </p>
  
  <pre><code>deb http://ftp.de.debian.org/debian-archive/debian/ lenny main
  deb-src http://ftp.de.debian.org/debian-archive/debian/ lenny main 
  </code></pre>
  
  <p>to your sources.list and try to get the package.</p>
  
  <p>Or, of course, try the Debian backports:</p>
  
  <pre><code>deb http://backports.debian.org/debian-backports squeeze-backports main
  </code></pre>