Updating mercurial in Ubuntu 14.04 LTS
Matt Mackall
mpm at selenic.com
Tue May 20 17:44:24 UTC 2014
On Tue, 2014-05-20 at 12:04 +0200, Angel Ezquerra wrote:
> On Sun, May 18, 2014 at 12:18 PM, Yuya Nishihara <yuya at tcha.org> wrote:
> > On Sun, 18 May 2014 12:00:08 +0200, Angel Ezquerra wrote:
> >> This is quite odd. I did:
> >>
> >> $ which hg
> >> /usr/bin/hg
> >> $hg version
> >> Mercurial Distributed SCM (version 2.6.2+72-b90ae5d9e9c7)
> >> ...
> >>
> >> So it seems mercurial was version 2.6.2.
> >> Then I did:
> >>
> >> $ sudo apt-get purge --remove mercurial
> >> ...
> >> Removing mercurial-common (2.8.2-1ubuntu1) ...
> >> ...
> >>
> >> So this told me that it was removing mercurial 2.8.2 even though I had
> >> mercurial 2.6.2?
> >>
> >> $ which hg
> >>
> >> The result was empty. So it seems that mercurial was uninstalled.
> >>
> >> Then I did:
> >> $ sudo apt-get autoremove
> >> $ sudo add-apt-repository ppa:jacob/hg
> >> $ sudo apt-get update
> >> $ sudo apt-get install mercurial
> >> ...
> >> Setting up mercurial (3.0-0~14.04~ppa0) ...
> >> ...
> >>
> >> $ which hg
> >> /usr/bin/hg
> >> $ hg version
> >> Mercurial Distributed SCM (version 2.6.2+72-b90ae5d9e9c7)
> >>
> >> Wait, what? How did I get mercurial 2.6.2 back?
> >
> > Probably you have old mercurial libs somewhere in your PYTHONPATH.
> > Try
> >
> > $ python -c 'import mercurial; print mercurial.__file__'
> > and
> > $ hg debuginstall
> >
> > Regards,
>
> Yes, that was it thanks! :-D
>
> I did "sudo pip install --upgrade mercurial" and everything works fine now.
>
> I'd like to understand this a little bit better though. How comes that
> mercurial 3.0 can be installed but when you execute it it runs the
> modules on the PYTHONPATH? Doesn't the Linux mercurial install come
> with its own python environment as I think it does on windows?
The preferred way to install everything on Linux is via the native
package manager. If you use pip and the native package manager to
install the same package, You're Going To Have A Bad Time™.
And no, it's generally considered a sin on Linux for an app to install a
private copy of a shared library or interpreter, so you will basically
never see an application like Mercurial include a private Python in a
normal Linux install (especially given that most of them come with
Python pre-installed). And this will absolutely never happen with a) pip
or b) the native package manager.
In this particular case, the issue is probably that our setup.py process
stores the path to the libraries installed at build time in /usr/bin/hg.
Your pip install overwrote the Ubuntu copy of this file and thus points
at the pip copy.
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial
mailing list