4

I have a corporate Linux server which does not have internet connection, and sudo access needs to be approved through many levels of hierachy. I've tried install git but I soon realized this needs a whole bunch of dependencies like C compiler to install, of which I do not have the dependencies.

What I need is a method to have git on my server, maybe installing it as a standalone, taking care of the dependencies that are required, without internet or preferbly sudo. It's very straight forward in windows box, but I am stuck for Linux.

Problem with this solution is that it still requires sudo.

Help please!

  • Getting sudo access yourself might be impractical, but surely the machine has an administrator who's already able to install things? – Wyzard Aug 27 '15 at 14:54
  • 1
    Nope - it's a highly secure environment as mentioned. Approvals don't come easily without a strong business case. – George Aug 28 '15 at 8:06
  • 1
    Maybe you shouldn't try to install software on a highly-secure computer without approval, if you can't even state a business case for why it's needed. :-) – Wyzard Aug 28 '15 at 14:48
  • @Wyzard: I have to work in a similar situation. What you say makes sense, but in practice, it becomes a hassle to deal with the approval process for using sudo, even worse for temporary connections, so these need to be avoided as much as possible. In my daily life, uploading files to the server is okay, hence whatever does not involve internet and sudo can be done much more smoothly. Now, imagine convincing someone who does not code that you need Git (and what it actually is). Not impossible, but that does not translate to dollars that quickly, and is another hassle in itself. – Mefitico Jan 15 at 19:43
2

I found a solution that works. To iterate my steps:

1) Download relevant RPM (or here)

2) Copy to Linux server and upack using (replace filename as necessary)

rpm2cpio git-1.7.9.6-1.el6.rfx.x86_64.rpm | cpio -idmv

3) Update $PATH:

PATH=$PATH:<your path to git>/usr/bin

4) Now see it work

git --version
  • This worked for me too. Compiling from source is not really practicable unless you happen to have all the right libraries already installed. – ultracrepidarian Jul 21 '16 at 1:24
  • Is there a place to download git compiled binaries and just extract them? – Royi Jul 27 '17 at 21:27
0

You can download the git source and do ./configure --prefix=/home/user/myroot && make && make install to install git to your home directory provided you have the build tools. If you don't have the build-essential package installed (dpkg --list|grep build-essential), you will need to install those to your home directory as well.

Copied from this link

  • Hi, yeap that's what I tried at first. That required a whole lot more dependencies (and their dependencies) and compilers and some of those require sudo installation rights. – George Aug 28 '15 at 8:05
  • Is there a place to download git compiled binaries and just extract them? – Royi Jul 27 '17 at 21:27
0

I guess that if you can't install dependencies then you are out of luck. If you can't install package(and its dependencies), then your best shot would be compiling it yourself - but that too would need dependencies(there is no magic to leave them out). Also, compiling requires compiles(as name suggests), so if you can't get a compiler, then you're in a bad position. If I were you, I would either seek other tool which you already have, or send request and wait for approval...

  • is there a package that can untar and run? – George Aug 28 '15 at 8:35
  • If you untar'd this package, you would simply have git package. It still needs dependencies - as I said, they don't simply vanish. You would have to download and install all other packages. And to install package, you need sudo. – MatthewRock Aug 28 '15 at 8:39
0

Please find below the Steps I followed to install Git without internet access on the system

  1. Download the desired tarball from below link, on your PC/Laptop https://www.kernel.org/pub/software/scm/git/

I used the Git-2.8, as the customer requirement was to have version >= Git-2.74

  1. Connect to remote Linux system (via winscp or nay other remote connectivity tool). And Place/Move the downloaded git-XXXXXX.tar.gz file on desired location on the linux system where you want to install ‘git’.
    I placed it in Directory: /var/opt/teradata/packages/Package/GIT/

  2. From command prompt go to the directory where you placed the above file and run below command to untar the package tar -xvzf git-2.8.0.tar.gz

  3. CD into the directory that is newly created because of untar command above. cd git-2.8.0/

  4. Verify that all the needed files and directories have been uncompressed into the above folder ls -ltr

  5. Set the Path and Prefix variables with commands below.

PATH=$PATH:/var/opt/teradata/packages/Package/GIT/git-2.8.0/usr/bin

PATH=$PATH:/var/opt/teradata/packages/Package/GIT/git-2.8.0

export PATH=$PATH:/var/opt/teradata/packages/Package/GIT/git-2.8.0

make prefix=/usr/local/git all

echo $CC

  1. Run Below command to check the preinstall configuration checks ./configure

  2. Run Below command to install.

make install

  1. Now see it work with below command

git --version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.