0

When using mbed-cli to update an Mbed repo, I get the following error:

john@john-ThinkPad-Yoga-11e:~/Projects/myRepo$ mbed update
[mbed] Working path "/home/john/Projects/myRepo" (program)
[mbed] Updating program "myRepo" to latest revision in the current branch
[mbed] Updating library "mbed-os" to rev #c966348d3f9c (tag: mbed-os-5.11.1)
*** failed to import extension hggit from /path/to/hg-git: [Errno 2] No such file or directory: '/path/to/hg-git'
*** failed to import extension hggit from /path/to/hg-git: [Errno 2] No such file or directory: '/path/to/hg-git'

I do not want to use hg-git and have tried to remove it entirely. Mbed-cli uses Python so I tried various Python tools to remove hg-git but am still getting the error. I am not even sure it is actually an error from mbed-cli as it appears after things that I know are part of mbed (ie, lines starting with "[mbed]"). I also tried to find the source of the error in a file (using 'grep -rnw . -e "hg-git"') but as a bit of a newb on Ubuntu I have not been able to do so.

Any ideas as to the source of the error message and/or how I might get rid of it and remove hg-git in its entirety?

J Greene
  • 115
  • 1
  • 9

2 Answers2

0

Use apt command to remove hg-git

$ sudo apt remove hg-git
Ho1
  • 1,239
  • 1
  • 11
  • 29
  • Thanks but I'd already done that. I did so again to confirm with result: 'E: Unable to locate package hg-git' – J Greene Jul 16 '19 at 17:24
  • You can use `sudo apt purge hg-git` to purge configuration files. Also, please try this: https://stackoverflow.com/questions/5133641 – Ho1 Jul 16 '19 at 17:54
  • Same result with "purge" and nothing in the approved answer in the link seems applicable nor does it work: ./myRepo$ sudo apt purge hg-git [sudo] password for john: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package hg-git ./myRepo$ python -c "import hggit" Traceback (most recent call last): File "", line 1, in ImportError: No module named hggit ./myRepo$ head -n1 'which hg' head: cannot open 'which hg' for reading: No such file or directory' – J Greene Jul 16 '19 at 20:20
  • Use this: `sudo apt remove hg-git*` or `sudo apt remove hg-git --purge` – Ho1 Jul 17 '19 at 03:59
  • No luck, @Ho1, although a few new/different messages: ' ./myRepo$ sudo apt remove hg-git* [sudo] password for john: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package hg-git* E: Couldn't find any package by glob 'hg-git*' E: Couldn't find any package by regex 'hg-git*' ./myRepo$ sudo apt remove hg-git --purge Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package hg-git ' – J Greene Jul 17 '19 at 14:49
0

The hggit extension is still enabled in the Mercurial configuration.

You can show the file and line of where the configuration is set by running: hg config extensions.hggit --template '{source}\n'.

It may return something like /home/user/.hgrc:12. In this case, you have to remove or comment out line 12 in the file /home/user/.hgrc to disable the hggit extension.

Manuel Jacob
  • 1,897
  • 10
  • 21