On the 1st of March 2011 version 2.0 of TortoiseHG was released - and the people rejoiced. 2.0 features a much-refined interface allowing the user to perform most of the common tasks from a single dialog, instead of having to switch between a swathe of different dialogs. Unfortunately this new version is not available as a package under the Ubuntu repositories yet, but in this post you will find out how to install TortoiseHG 2.0 under Ubuntu 10.10.
This how-to was written and tested under a completely fresh install of Ubuntu 10.10 Desktop Edition. If you are performing this install on a system that already has a version of either Mercurial or TortoiseHG on then you must remove it first.

Also - you must have the Universe source enabled in '/etc/apt/sources.list'.

Let's get root first - and if needs be remove any previously installed packages.

Shell

1

2

sudo su

apt-getpurge mercurial tortoisehg tortoisehg-nautilus

TortoiseHG 2.0 requires a newer version of Mercurial, as well as a few other packages that we may not have insatlled at the moment, so go ahead and install them.

Now we're ready to install Mercurial 1.8 - we must grab the sources from the mercurial release site, extract, compile and install it.

Shell

1

2

3

4

5

6

cd/tmp

wget http://mercurial.selenic.com/release/mercurial-1.8.tar.gz

tar zxvf mercurial-1.8.tar.gz

cdmercurial-1.8

makelocal

checkinstall#hit enter a few times, the default settings are fine

Once the above steps have been completed you should have Mercurial 1.8 installed and working - test this by typing the following. If the version output states is anything other than 1.8 then you most likely still have an older version of Mercurial installed or available under PATH. If so, go back to the top of this how-to and perform the required 'apt-get purge'.

Shell

1

2

hg version

Mercurial Distributed SCM(version1.8)

Now it's time for us to install TortoiseHG 2.0. To do this we need to pull a clone from the TortoiseHG repo on bitbucket, and create a symlink.

Shell

1

2

3

cd/opt

hg clonehttp://bitbucket.org/tortoisehg/thg tortoisehg

ln-s/opt/tortoisehg/thg/usr/bin

We are almost there! One last thing that we need to do is make a link to the Nautilus extension from the repo we just cloned so that we can make use of the context menu in the Nautilus file browser to perform actions with TortoiseHG.

Perform these steps as the user that you usually work as (i.e. administrator, SomeGuy).

Thanks for the guide, was about to go ahead but thought I’d search for ppa packages first and found some to make it easier: this worked for me: (with 1.1 already installed)
sudo apt-add-repository ppa:mercurial-ppa/releases
sudo apt-add-repository ppa:tortoisehg-ppa/releases
sudo apt-get update
sudo apt-get upgrade
nautilus -q

Nice, thanks Owen – that’s definitely cleaner than having to compile everything from scratch! I think I saw that exact method not too long ago, but also read feedback that it did not work for a few people, so held off on posting it on here 🙂

Hi, I tried your approach with Ubuntu 11.04 and I got till the tortoisehg context part. However, whatever I click does not have any effect. I can’t clone, open workbench etc etc. Just no response. Any ideas? Or where can I find debug logs?