Question

I need to install git on cPanel but I am finding a lot of information indicating that this is not a simple process.

I have a cPanel/WHM instance on a CentOS distribution and am trying to install git without breaking cPanel. The information I have found says that installing git can break cPanel because of the Perl dependencies.

This page on cPanel's forums advises against installing git:

http://forums.cpanel.net/f391/installing-git-294411.html

However, this page under the cPanel Features says that an RMP has been released for git:

http://features.cpanel.net/responses/possibility-to-install-git-on-cpanel-server-without-breaking-it

I requested support from cPanel and was given this response:

We actually do not recommend the installation of GIT unless you are very experienced with it's install due to it having the possibility of breaking perl.

We do distribute the git RPM as a convenience during install, however, it's not setup or supported - it's only added as a convenience and requires manual install of further packages and configuration.

The RPM we provide for git installs the binary to /usr/local/cpanel/3rdparty/bin so you will need to run it out of here. It's not the full tool set, so anything outside of this would need to be installed by the systems administrator.

Does anyone have advice on how best to install git on cPanel such that all cPanel user accounts will be able to use git, make sure that the installation doesn't break Perl, and what is missing in the RPM provided by cPanel based on the statement in the last paragraph quoted above?

Was it helpful?

Solution

I figured out the same problem, but I find out that from the WHM/Cpanel version 11.36+ Git is installed by default in the system and available for all the account.

You have just to create a Git's account (be sure to add remote ssh access) then in your .bashrc you add just this alias

alias git="/usr/local/cpanel/3rdparty/bin/git"

then if you type git in the user's shell, it should just work automagically ;)

Cheers

OTHER TIPS

cPanel disables Perl updates to protect its own binaries, which are git dependencies.

Just run yum with the following lines.

sudo yum install git --disableexcludes=main --skip-broken

Remember if you are updating the bashrc file to reload this so you dont have to restart your SSH session by using:

source ~/.bashrc

http://www.codefuel.co.uk/cpanel-git-resolved/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top