The dependency errors you're encountering stem from CentOS 6's aged package repositories and potential conflicts with WHM/cPanel's custom package management. The key errors indicate missing:
- Essential libraries (libcrypto.so.10, libssl.so.10, etc.)
- Perl modules (perl-Error, perl-Git)
- 32-bit compatibility packages
First verify your architecture:
uname -m
You might be trying to install i686 packages on x86_64. The error shows mixed architecture requirements.
Install required dependencies before git:
yum install perl-Error perl-Git openssl098e-0.9.8e-17.el6.centos.2 xz-libs libcurl
For newer Git versions (recommended):
# Add IUS repo
yum install https://centos6.iuscommunity.org/ius-release.rpm
# Install Git 2.x
yum install git2u
When package managers fail:
# Install build dependencies
yum groupinstall "Development Tools"
yum install zlib-devel perl-ExtUtils-MakeMaker openssl-devel
# Download and compile
wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.37.1.tar.gz
tar -xzf git-2.37.1.tar.gz
cd git-2.37.1
make prefix=/usr/local all
make prefix=/usr/local install
If you're getting SafeFile errors:
/scripts/checkperlmodules
/scripts/perlinstaller --force Error.pm
After successful installation:
git --version
ldd $(which git) # Check linked libraries
For legacy systems where native installation fails:
docker run -v /path/to/code:/code -it alpine/git sh
When attempting to install Git on CentOS 6.0 x64, you're likely encountering these fundamental issues:
error: Failed dependencies:
libcrypto.so.10 is needed by git-1.7.1-2.el6.i686
libcurl.so.4 is needed by git-1.7.1-2.el6.i686
perl(Error) is needed by git-1.7.1-2.el6.i686
The core problem stems from multiple factors:
- Missing 32-bit compatibility libraries on a 64-bit system
- Incomplete Perl module installations
- Potential repository conflicts from WHM/cPanel
Here's the complete fix procedure:
Step 1: Install Required Libraries
yum install glibc.i686 libcurl.i686 libexpat.i686 openssl.i686 zlib.i686
Step 2: Install Perl Dependencies
yum install perl-Error perl-Git
If you encounter repository conflicts with WHM/cPanel:
yum --disablerepo=cpanel --skip-broken install git
Step 3: Alternative Compilation Method
If YUM still fails, build from source:
# Install build dependencies
yum groupinstall "Development Tools"
yum install gettext-devel openssl-devel perl-CPAN perl-devel zlib-devel
# Download and compile
wget https://www.kernel.org/pub/software/scm/git/git-2.37.3.tar.gz
tar -zxf git-2.37.3.tar.gz
cd git-2.37.3
make configure
./configure --prefix=/usr/local
make all
make install
After installation, verify with:
git --version
which git
For servers running WHM/cPanel, additional steps may be needed:
/scripts/check_cpanel_rpms --fix
/scripts/upcp --force
yum clean all
yum update
For newer Git versions on CentOS 6:
yum install https://repo.ius.io/ius-release-el6.rpm
yum install git2u
Update your PATH if compiling from source:
echo 'export PATH=$PATH:/usr/local/git/bin' >> /etc/bashrc
source /etc/bashrc