Skip to content

Instantly share code, notes, and snippets.

@mritzco
Last active January 4, 2020 16:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mritzco/b4fcb14a0e362476cf277afdf9d3466c to your computer and use it in GitHub Desktop.
Save mritzco/b4fcb14a0e362476cf277afdf9d3466c to your computer and use it in GitHub Desktop.
Installing TortoiseHG on linux (2018 PPA not working)

Installing TortoiseHG

(June 2018)

PPA for tortoise is gone and Tortoise is removed when mercurial is updated.

If you're ok having an old version of Mercurial, you can reinstall following this guide:

First let's see the requirements:

sudo apt-get install tortoisehg
   The following packages have unmet dependencies:
   tortoisehg : Depends: mercurial (< 3.10~) but 4.4.1~xenial1 is to be installed
  E: Unable to correct problems, you have held broken packages. 

Required version: mercurial (< 3.10~)

Step 1. Remove the updated mercurial

sudo apt-get remove mercurial mercurial-common

Step 2. Find available versions of mercurial and dependencies

$ apt-cache policy mercurial
mercurial:
  Installed: (none)
  Candidate: 4.4.1~xenial1
  Version table:
     4.4.1~xenial1 500
        500 http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial/main amd64 Packages
     3.9.1-0~16.04~ppa0 500
        500 http://ppa.launchpad.net/jacob/hg/ubuntu xenial/main amd64 Packages
     3.7.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

The best matching version is 3.9...

You will need the whole version number, just select and wheel/middle button click or copy-paste it.

$ sudo apt-get install mercurial=3.9.1-0~16.04~ppa0
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Some packages could not be installed. This may mean that you have
  requested an impossible situation or if you are using the unstable
  distribution that some required packages have not yet been created
  or been moved out of Incoming.
  The following information may help to resolve the situation:

  The following packages have unmet dependencies:
   mercurial : Depends: mercurial-common (= 3.9.1-0~16.04~ppa0) but it is not going to be installed
  E: Unable to correct problems, you have held broken packages.

We're also missing mercurial-common. Let's find the matching available version.

$ apt-cache policy mercurial-common
mercurial-common:
  Installed: 4.4.1~xenial1
  Candidate: 4.4.1~xenial1
  Version table:
 *** 4.4.1~xenial1 500
        500 http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/mercurial-ppa/releases/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status
     3.9.1-0~16.04~ppa0 500
        500 http://ppa.launchpad.net/jacob/hg/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/jacob/hg/ubuntu xenial/main i386 Packages
     3.7.3-1ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages

Copy the version, now let's install all.

Step 3. Install all dependencies and tortoise

Don't forget to update the versions by doing the previous steps, if the package manager cannot find your version it will not work.

$ sudo apt-get install mercurial=3.9.1-0~16.04~ppa0 mercurial-common=3.9.1-0~16.04~ppa0
# Now install as usual
$ sudo apt-get install tortoisehg

Tortoisehg should be available again.

@S204STi
Copy link

S204STi commented Jul 19, 2019

Thanks for writing this up. New to using linux for dev and this was a huge help!

@mritzco
Copy link
Author

mritzco commented Jul 20, 2019

Glad it did, good luck in your dev adventures in Linux. I'm sure you'll love it

@stigfromsouth
Copy link

Just run
sudo apt-get install -y mercurial mercurial-common tortoisehg
and it works fine without any tricks
on Ubuntu 18.04.3 LTS \n \l

@mritzco
Copy link
Author

mritzco commented Nov 1, 2019

Yes, It works fine again. For a while there was a problem with the repos and those instructions were useful.

@VioletGiraffe
Copy link

@stigfromsouth E: Unable to locate package tortoisehg - gone again :( Any idea why, what's going on with the TortoiseHg package? I've been using it for 8 years and this is the first time it's having problems like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment