How to install Git on cPanel/WHM server running CentOS

Today I wanted to install Git on a server with cPanel/WHM and have got the following result:

yum install git
Resolving Dependencies
--> Running transaction check
---> Package git.x86_64 0:1.7.1-4.el6_7.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-4.el6_7.1 for package: git-1.7.1-4.el6_7.1.x86_64
--> Processing Dependency: perl(Git) for package: git-1.7.1-4.el6_7.1.x86_64
--> Processing Dependency: perl(Error) for package: git-1.7.1-4.el6_7.1.x86_64
--> Finished Dependency Resolution
Error: Package: git-1.7.1-4.el6_7.1.x86_64 (base)
           Requires: perl-Git = 1.7.1-4.el6_7.1
Error: Package: git-1.7.1-4.el6_7.1.x86_64 (base)
           Requires: perl(Git)
Error: Package: git-1.7.1-4.el6_7.1.x86_64 (base)
           Requires: perl(Error)
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

Then I did some research and have found out that Gis is already installed on cPanel as of version 11.36 but the problem is – it’s installed on this path:

/usr/local/cpanel/3rdparty/bin/git

So for ease of use I advise you to make a simple symlink:

ln -s /usr/local/cpanel/3rdparty/bin/git /usr/bin/git

so you don’t have to remember the path above and you can simply use it like you got used.

Note: In order for user to be able to login to SSH, it must be allowed in WHM first at Account Functions > Manage Shell Access and there  just switch from Disabled Shell to Jailed Shell.

Happy Gitting!

View Comments

    • You are not removing it... You're just making a symlink so in order to make it available (work).

  • I was having the same original issue where cPanel would fail the update process.

    I removed the 'git' package (which removed the 'perl-Git' package as well) on CentOS, as, the cPanel package is called 'cpanel-git'. This will leave git installed at the path mentioned above, and allow you to symlink it for general use as per the instructions above. cPanel system update ran through successfully after this was done.

    #yum uninstall git
    #ln -s /usr/local/cpanel/3rdparty/bin/git /usr/bin/git

Share
Published by
Nick
Tags: git

Recent Posts

How to Manage Storage on Smartphone: 12 Ways

Can't download new apps to your phone because there isn't enough storage space? Lack of…

10 months ago

Spotlight Search won’t open the files it finds in Dropbox with associated application

This issue started to appear on macOS 13 Ventura after recent Dropbox update. I would…

1 year ago

Windows 10 Search fix

Since this morning (Feb 5th 2020) search just stopped working on my Windows 10 (version…

4 years ago

The mysql_result in mysqli

Many of you have run into a problem when you were working on some old…

4 years ago

How to convert physical Windows PC into a virtual machine

After 10 years of running my main desktop computer on Windows 7 - time has…

4 years ago

How to downgrade PHP 7.4 to PHP 7.3 on VestaCP running on CentOS 7

I installed VestaCP for a clien on a new dedicated server running CentOS 7. Once…

4 years ago