0

I am not so into Linux and I have the following problem.

I have entered via SSH into my Linux shell on a Bluehost server and doing:

git --version

I saw that I have a vary old version of git:

-jailshell-4.1$ git --version
git version 1.7.11.3

So I followed this guide to install a new version of GIT on my server: http://willjackson.org/blog/installing-git-bluehost-shared-hosting

So I have created the .local directory into my home directory and into it I have creaated the src directory where I have downloaded the last version of GIT doing:

wget --no-check-certificate https://github.com/git/git/archive/master.zip

I have unzipped this zip file and I have correctly done the make and make install statment. I have obtained no errors.

The problem is that doing git --version I still obtain the old git version 1.7.11.3 and not the newer installed one.

First I modified the .bashrc file putting this line at the end:

export PATH=$HOME/.local/bin:$HOME/.local/usr/bin:$PATH

but reading the comments to the previous tutorial I read that:

This actually doesn't work like seems... Bluehost has git installed by default in /usr/bin/git (as David Lichtenberg observed below). You can verify this by running which git from the command line.

The problem is that the version of git that Bluehost provides is pretty old (1.7.11.3). After following the steps above, running git --version will still report git version 1.7.11.3 meaning the latest version of git that you just downloaded isn't the one being used.

To remedy this you'll need change the export in your .bashrc (that you entered in step 4) to:

export PATH="$HOME/.local/src/git-master:$PATH"

Then just exit and log back in and you should be good to go. Running which git should return /[home]/[username]/.local/src/git-master/git.

So I have changed my .bashrc file as suggested in this comment, so now my .bashrc file contains:

# .bashrc

# User specific aliases and functions

# Source global definitions
# if [ -f /etc/bashrc ]; then
#       . /etc/bashrc
#fi

export PATH="$HOME/.local/src/git-master:$PATH"

I think that this nw export version say to use the git version that is installed inside the $HOME/.local/src/git-master folder.

Where HOME is /home6/onofrior (the home directory of my server).

Then I have exit the ssh session and I log into again.

The problem is that doing git --version I still obtain the old git version 1.7.11.3 and not the last one installed, infacti this is the output:

-jailshell-4.1$ git --version
git version 1.7.11.3

If I directly execute ./git --version in the directory where the new version of GIT is correctly installed infact I obtain the expected output related to the last git version:

-jailshell-4.1$ pwd
/home6/onofrior/.local/src/git-master
-jailshell-4.1$ ./git --version
git version 2.10.0.GIT

So it means that the last version of GIT is correctly installed into my /home6/onofrior/.local/src/git-master directory.

I think that the problem is into the .bashrc file or somwthing related to how is specified what GIT version have to be used by the shell, in

Maybe the problem is that Bluehost is using this strange jailshell-4.1$ or something like this?

Why? What is wrong? What am I missing? How can I fix this issue?

Tnx

  • Be more specific about what OS you are running. Most Linux distributions backport fixes and then build the application, so the versions of said application that are installed by default or their app-get repository, are normally much newer then the version that is reported by the application. Your job is to determine, if thats the case, or if the application really is not updated. – Ramhound Oct 6 '16 at 19:37
  • @Ramhound I really don't know what exact version is used on Bluehost server, I do: -jailshell-4.1$ uname -a Linux box508.bluehost.com 3.12.52-20160119.106.ELK6.x86_64 #1 SMP Tue Jan 19 16:53:32 CST 2016 x86_64 x86_64 x86_64 GNU/Linux – AndreaNobili Oct 6 '16 at 19:41
0

The .bashrc file is not read by default. However, the .bash_profile is and you can source your .bashrc from there.

Run the following:

cd ~/
vi .bash_profile

Hit the letter i for Insert and type in source ~/.bashrc Then hit the esc key followed by :wq

Exit the session, log back in and then type git --version

You should be good to go

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.