Backporting mercurial 0.9.5 to Ubuntu 7.10 “Gutsy”

by gldnspud on January 11, 2008

I've fallen in love with Mercurial. It's used by projects and people that I respect, and I'm using it more and more.

I wanted to make sure I was using the latest version, but I didn't want to uninstall gutsy's version 0.9.4 and install it from source, nor did I want to upgrade my entire system to hardy. I've played around with such bleeding-edge things in the past, and while I still like to bleed sometimes, the Linux desktop is not one of those areas in which I desire to. :)

So, what to do?

Fortunately, it's easy to backport it from hardy. Here's what I did:

  1. $ vim /etc/apt/sources.list

  2. Add this line to the end:

    deb-src \
        hardy main restricted universe multiverse
  3. Save and exit.

  4. $ sudo apt-get update

  5. $ sudo apt-get build-dep mercurial

  6. $ fakeroot apt-get source -b mercurial

  7. $ sudo dpkg -i mercurial_0.9.5-2_i386.deb

Lather, rinse, then repeat steps 4 through 7 as necessary if you're anxious. Or, just wait three months for hardy. :)


Mike January 16, 2008 at 1:13 pm

Thanks for this tip. In trying it, I notice Step 5 needs to be “sudo apt-get build-dep mercurial”.

Jamie Whitehouse February 12, 2008 at 10:53 am

Any chance we could see this published in a Personal Package Archive (PPA) for those of use who don’t have the whole dev toolchain installed?

gldnspud February 13, 2008 at 11:18 am

@Mike: Thanks, I’ve corrected that mistake.

@Jamie: I just switched to Mac OS X again as my primary workstation, and 8.04 will hopefully be released on time, so I don’t think I will be the one to create a PPA. If someone else does though, I’ll gladly link to it at the top of this post. :)

David Van Couvering February 28, 2008 at 2:11 pm

Thanks, this was a life-saver! 0.9.4 is not supported in my group, and I really had no idea how to upgrade. I would *not* have been able to figure out these steps for the life of me – I actually still don’t know what I just did, but it worked! :)

gldnspud February 28, 2008 at 3:51 pm

@David: I’m glad it worked out well for you! It did take me a few years to remember all the pieces involved in doing something like that, and it’s still magical for me. I applaud Debian for building such a great set of tools.

What you just did was take a source package for something that’s in hardy but not gutsy, installed all of its build dependencies (which *are* in gutsy), built the source package into a .deb file, then installed the resulting .deb file. :)

Mekk March 4, 2008 at 7:55 am

Tiny (non-crucial) suggestion – it might be slightly more manageable to create the new file /etc/apt/sources.list.d/hardysources.list (or so) and put the deb line there instead of editing main sources.list (which is better left for GUI tools). The rest works in the same way

Comments on this entry are closed.

Previous post:

Next post: