7

I have a user account on a Linux server (x86_64-unknown-linux-gnu, according to this). It apparently has no package managers in the $PATH (yum, apt-get, pkg, pkg-add, emerge, pacman), and it does not have cc. (edit by the way, this is a shared hosting server. so the tech support people were just following scripts when I tried to ask them for advice. they also wanted to upsell me to their VPS package, which I don't need or want)

I would like to install git into ~/bin. It's not necessary that I do so, but it sure would make my life a lot easier. However, all of the instructions I've found online with respect to installing git have to do with either:

  1. using a package manager (which I don't seem to have access to)
  2. installing from source (which I can't, because I don't have cc)

Linux is not my native OS, so I'm kind of at a loss as to how to proceed. What do I need to do? Is there a place where I can download pre-compiled binaries and see if any of them work?

4
  • Tried talking to your friendly System Administrator?
    – andol
    Jun 30, 2012 at 17:50
  • Think there is a reason why you don't have access to a package manager- go and talk to the owner/manager of this server :)
    – AliGibbs
    Jun 30, 2012 at 17:51
  • @andol yes, they said they "don't support" me running git myself. However, I figure that if I have a ~/bin folder and ssh access, that ought to be enough to get things going... However, if I put forward a good effort and can't get it to work, I'm willing to admit defeat. Jun 30, 2012 at 17:52
  • By the way, this is a shared hosting server, so the "admin" is really just tech support with a script - not very helpful. :) Jun 30, 2012 at 17:54

3 Answers 3

4

I'm that guy :-)

Here is small howto and info what we did.

First we tried executing git binary from the latest Ubuntu server which returned glibc error that Dave copied above.

Then with the help of command ldd --version we found which glibc is installed on the server and what distribution is it.

Here is the list of glibc versions and Linux distributions that have them

http://en.wikipedia.org/wiki/GNU_C_Library

So Glibc 2.5 gave us a clue that RHEL 5 is used on the server, so next step was to find propper git.rpm file, google gave us repo http://pkgs.repoforge.org/git/ and to unpack it without installation as we don't have privileges for that.

As a result we got git bin which worked directly so after settng path everything was fixed.

Glad that I could help :-)

6

SUCCESS! With the help of a guy on Twitter, I was able to figure this out.

I found some rpms for git online, but when trying to execute them, I got things like this:

./git: /lib64/libc.so.6: version `GLIBC_2.7' not found (required by ./git)

So my version of libc wasn't what git was looking for. So, what version of C do I have?

$ ldd --version                                                                                                                                                                   
ldd (GNU libc) 2.5
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

I have 2.5. This also means that I'm running on Red Hat Enterprise Linux 5. So now it's off to find the rpm for 64-bit git on RHEL5. Here it is: http://pkgs.repoforge.org/git/git-1.7.9.6-1.el5.rf.x86_64.rpm

I downloaded that and unpacked it using The Unarchiver (for rpm => cpio conversion) and Archiver (for cpio extraction). I then uploaded the resulting git folder to ~/bin. I fixed up my $PATH to point to the new stuff:

PATH=$PATH:$HOME/bin/git/usr/bin

And now it works great!

1
  • 1
    what I did is, using rpm2cpio ***.rpm | cpio -idmv, to extra the.rpm file. Thank you so much for your tips! Save a lot of time!
    – Shiro
    Dec 27, 2012 at 7:24
5

i think what you need is a static binary of git.

i found this link: http://www.lyraphase.com/wp/uncategorized/how-to-build-git-for-a-host-with-no-compiler/

2
  • Thanks, I came across this as well, and am in the process of downloading some Linux ISOs to try and see if I can get it to compile in one of those. Seems like an awful lot of work just to get a single binary, though... Jun 30, 2012 at 17:54
  • Is there a place which shares pre built GIT Binaries for Linux?
    – Royi
    May 18, 2018 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .