Installing Git on a Debian Lenny server

debian, git, lenny

Solution

Because Lenny is no longer supported, I strongly recommend migrating this machine (or services) to a newer release. At the very least, severely firewall this machine and restrict access to it to only the most trusted of your users -- without security updates, a newly discovered remote compromise or local privilege escalation could give you far more trouble than upgrading.

That said, the backports project provides newer builds of packages for older systems. You can add the required `deb` line to your `apt` `sources.list` file -- I'm going to guess it looks something like this:

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

then run

apt-get update
apt-get -u -t lenny-backports install git-all

(I'm taking the `git-all` package name from a packages.debian.org lookup, which shows it is available for `lenny-backports`.)

The `-t` pins that package to that release. It's not something you'd use every day, but the one time you need it, it is worth its weight in saffron.

Problem

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 ```

Original source

Related problems