Ubuntu – How to install the tortoisehg in Ubuntu20.04

software installation

I'm trying to install tortoiseHG with:

$ sudo dpkg -i tortoisehg_4.8.1-0.1_all.deb
Selecting previously unselected package tortoisehg.  
(Reading database ... 172882 files and directories currently installed.)  
Preparing to unpack tortoisehg_4.8.1-0.1_all.deb ...  
Unpacking tortoisehg (4.8.1-0.1) ...  
dpkg: dependency problems prevent configuration of tortoisehg:  
 tortoisehg depends on mercurial (<< 4.9~); however:  
  Version of mercurial on system is 5.3.2-1+exp1.  
 tortoisehg depends on python-pyqt5; however:  
  Package python-pyqt5 is not installed.  
 tortoisehg depends on python-pyqt5.qsci; however:  
  Package python-pyqt5.qsci is not installed.  
 tortoisehg depends on python:any (<< 2.8); however:  
 tortoisehg depends on python:any (>= 2.7~); however:  

dpkg: error processing package tortoisehg (--install):  
 dependency problems - leaving unconfigured  
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...  
Processing triggers for desktop-file-utils (0.24-1ubuntu2) ...  
Processing triggers for mime-support (3.64ubuntu1) ...  
Processing triggers for hicolor-icon-theme (0.17-2) ...  
Processing triggers for man-db (2.9.1-1) ...  
Errors were encountered while processing:  
 tortoisehg  

How do I resolve those errors?

Best Answer

  • Update: I now do have a working package. It is available on github:

    https://github.com/glaure/tortoisehg4ubuntu

    Please give feedback!

    Old: I do not have a working package or snap. But using these instructions, it is rather easy to get tortoisehg working from source.

    1. Check that python --version returns a Python 3 interpreter. If not, you have to change the symlink /usr/bin/python to /usr/bin/python3.

      OK:

      $ python --version
      Python 3.8.2
      

      Not OK:

      $ python --version
      Python 2.7.18rc1
      

      Change the symlink:

      $ sudo rm /usr/bin/python
      $ sudo ln -s /usr/bin/python3 /usr/bin/python
      
    2. pip3 is needed to fulfill all the build dependencies.

      sudo apt install python3-pip build-essential
      
    3. Clone tortoisehg repository.

      hg clone https://foss.heptapod.net/mercurial/tortoisehg/thg
      
    4. Change into thg directory.

      cd thg
      
    5. Install PyQt5.

      pip3 install pyqt5
      
    6. Install mercurial.

      pip3 install mercurial
      
    7. Install Qscintilla.

      pip3 install qscintilla
      sudo apt install pyqt5.qsci-dev
      
    8. Lets build tortoisehg for inplace usage.

      make local
      
    9. Start tortoisehg.

      ./thg
      

    I got tortoisehg working on three different Ubuntu 20.04 installations using this recipe.

    Update: https://github.com/glaure/tortoisehg4ubuntu

    Contains scripts for automating the tasks listed above..