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# baseurlbaseurl=https://www.mercurial-scm.org/release/centos$releaseverskip_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 mercurialEnjoy using the latest version of Mercurial on your CentOS7 machine.