How To Install mercurial-git on Ubuntu 18.04

In this tutorial we learn how to install mercurial-git on Ubuntu 18.04. mercurial-git is Git plugin for Mercurial

Introduction

In this tutorial we learn how to install mercurial-git on Ubuntu 18.04.

What is mercurial-git

mercurial-git is:

The Hg-Git plugin for Mercurial adds the ability to push and pull to/from a Git server repository. This means you can collaborate on Git based projects from Mercurial, or use a Git server as a collaboration point for a team with developers using both Git and Mercurial.

The plugin can convert commits/changesets losslessly from one system to another, so you can push via a Mercurial repository and another Mercurial client can pull it and their changeset node ids will be identical - Mercurial data does not get lost in translation.

There are three methods to install mercurial-git on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install mercurial-git Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install mercurial-git using apt-get by running the following command:

sudo apt-get -y install mercurial-git

Install mercurial-git Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install mercurial-git using apt by running the following command:

sudo apt -y install mercurial-git

Install mercurial-git Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install mercurial-git using aptitude by running the following command:

sudo aptitude -y install mercurial-git

How To Uninstall mercurial-git on Ubuntu 18.04

To uninstall only the mercurial-git package we can use the following command:

sudo apt-get remove mercurial-git

Uninstall mercurial-git And Its Dependencies

To uninstall mercurial-git and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove mercurial-git

Remove mercurial-git Configurations and Data

To remove mercurial-git configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge mercurial-git

Remove mercurial-git configuration, data, and all of its dependencies

We can use the following command to remove mercurial-git configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge mercurial-git

References

Summary

In this tutorial we learn how to install mercurial-git package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.