How to install TortoiseHg on Ubuntu

There are linux installation packages available you can use: http://tortoisehg.bitbucket.org/download/#linux. But most of these are for old versions of TortoiseHg, so if you want the latest installing from source is the only way. So the following are the instructions on how to do this.

Install Mercurial

1
2
3
4
5
6
7
8
9
10
11
sudo su 
apt-get purge mercurial tortoisehg tortoisehg-nautilus python-dulwich mercurial-common
apt-get install python-dev python-docutils checkinstall python-qt4 pyqt4-dev-tools python-qscintilla2 appmenu-gtk python-nautilus python-setuptools python-iniparse
cd /tmp
# get latest url for source release from http://mercurial.selenic.com/downloads
wget http://mercurial.selenic.com/release/mercurial-3.7.1.tar.gz
tar zxvf mercurial-3.7.1.tar.gz
cd mercurial-3.7.1
make local
checkinstall # the default settings are fine so can just hit enter
hg version

Install TortoiseHg

1
2
3
4
5
6
cd ~/
hg clone http://bitbucket.org/tortoisehg/thg tortoisehg
cd tortoisehg/
hg update stable
ln -s ~/tortoisehg/thg /usr/bin
echo "%include ~/tortoisehg/contrib/mergetools.rc" >> ~/.hgrc

Integrate into File Explorer (Nautilus)

1
2
mkdir -p ~/.local/share/nautilus-python/extensions 
ln -s ~/tortoisehg/contrib/nautilus-thg.py ~/.local/share/nautilus-python/extensions nautilus -q

If you’d like to use HTTP/S when working with remote repositories see here on setting up mercurial_keyring to securely store passwords.

If using TortoiseHg with Git, it is recommended to update Dulwich to the latest version see here for details.

To Update

1
2
3
4
5
6
7
8
9
10
11
sudo su
cd /tmp
wget http://mercurial.selenic.com/release/mercurial-3.8.tar.gz
tar zxvf mercurial-3.8.tar.gz
cd mercurial-3.8
make local
checkinstall

cd ~/tortoisehg
hg pull
hg update stable