Programming TipsSSH Tips

How To Install Git On CentOS

If you are on a server using CentOS, you might have found that installing Git with Yum isn’t as easy as it is on some other server types. Yum on CentOS does not have a Git repo, but there is a fairly simple workaround. All we have to do is grab the repository we’re missing, then run the yum command to install it. Easy as pie!

Installing Git On CentOS

# Add the repository
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm

# Install the latest version of git
yum install --enablerepo=webtatic git-all

But there’s more!

Git SSL Certificate Problem On CentOS

If you’re following the installation instructions on GitHub or Bitbucket, you’ll notice that you’re now running into another error. Something like this: error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing.

We now need to download some SSL certificates. Some guides online recommend that you disable SSL authentication, but that’s a very dangerous road to travel. Instead, lets get the SSL certificates.

$  cd /etc/pki/tls/certs
$  curl http://curl.haxx.se/ca/cacert.pem | awk 'split_after==1{n++;split_after=0}
 /-----END CERTIFICATE-----/ {split_after=1} {print > "cert" n ".pem"}'
$  c_rehash

This should work for you up until the c_rehash command. Chances are, your system cannot find the command. Let’s fix that:

$  yum install openssl
$  yum install openssl-perl

Now, try the command and it should work:

$  c_rehash

Everything should be good to go! Continue following the directions provided to you on GitHub or Bitbucket, hopefully without any problems from here.

Join the discussion One Comment

Leave a Reply

Allen Gingrich

Author Allen Gingrich

Allen has worked on the web for over a dozen years. Like many young entrepreneurs, he began with a small workspace in his basement, where he eventually formed Ideas and Pixels. The rest, well, is history. Allen enjoys fine wines, weight training, and beautiful, semantic code.

More posts by Allen Gingrich

Join the discussion One Comment

Leave a Reply