Saturday, April 23, 2016

How to Install Mercurial in CentOS 7

Mercurial is an open-source distributed source control management tool. It is not available in CentOS default repositories and epel-release repository. However, it is possible to add it as a 'yum' package repository and get automatic updates. The procedure to do so is the following:
  • Create a new file in /etc/yum.repos.d/ by issuing the following command:
$ sudo touch mercurial.repo
  • Add the following contents into newly created 'mercurial.repo' file:
[mercurial]
name=Mercurial packages for CentOS7
# baseurl
baseurl=https://www.mercurial-scm.org/release/centos$releasever
skip_if_unavailable=True 
enabled=1
gpgcheck=0
  • Verify that the new repository is recognized by yum with the below command. You should be able to see the newly configured repository in the listed repositories.
$ yum repolist
  •  Install the latest version of Mercurial by issuing the following command:
$ sudo yum install mercurial
Enjoy using the latest version of Mercurial on your CentOS7 machine.