Thursday, October 07, 2010

Install Python 2.6 on ReadyNAS NV+

Just a few steps that worked for me. I can't be certain all the dependencies are listed here as I've been trying different things. If you come across anything that doesn't work let me know and I'll try to think if I've missed anything out.

If you're trying to install Python onto a ReadyNAS you'll find that the version you can get with "apt-get install python" will be around 2.3.something. If you need a later version you need to build it from source yourself. I only needed 2.6 and I found examples of other people being successful with building that version, so I haven't tried anything newer.

The instructions that follow are mainly from a post on the ReadyNAS forums and an article linked from that post. These may contain all the information you require without me setting out the steps again:
Ignore the fact that both of these are targeted at the DUO, the instructions work for an NV+ as well.

The instructions assume you have already installed the ToggleSSH, EnableRootSSH and APT addons (all listed under the ReadyNAS addons), and you know how to SSH to your NAS. I'm connecting from a Windows 7 box, so I just use PuTTY.
  1. SSH to your NAS
  2. Install the dependencies to build Python:
    • apt-get update
    • apt-get install libc6-dev
    • apt-get install gcc
    • apt-get install gdb
    • apt-get install libtag1-dev
    • apt-get install uuid-dev
    • apt-get install libssl-dev
    • apt-get install zlibc
    • apt-get install zlib1g-dev
  3. Make a directory to save the source to:
    • mkdir /root/src/
    • cd /root/src/
  4. Patch the "uniq" program (the wget command should be on 1 line, and note the dot at the end of the dpkg-deb command):
    • wget ftp://ftp.gnome.org/cdimage/snapshot/Debian/pool/main/c/coreutils/coreutils_5.2.1-2_sparc.deb
    • dpkg-deb -x coreutils_5.2.1-2_sparc.deb .
  5. Build Python:
    • wget http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz
    • gzip -d Python-2.6.6.tgz
    • tar xf Python-2.6.6.tar
    • cd Python-2.6.6
    • ./configure --build=sparc-linux
    • make
    • make install
Be aware that the last 3 commands in step 5 each take quite a while to complete.
And that's it. "python --version" should give "Python 2.6.6".

9 comments:

Panagiotis Atmatzidis said...

I was trying to install duplicity latest version and you saved a great deal of time to me.

Thanks for the quick howto.

FunKy said...

thaks a lot, very very helpful

Chris said...

Hmmm...no luck on my NV+. The build barfs with "make: *** [sharedmods] Error 132" and no other errors or clues. Suggestions gratefully received!

Kubular said...

Thanks!

Was really started to get fed up!
Saved me a lot of hassle, much appreciated.

Kubular said...

Thanks, you really saved me a lot of time and hassle, a good tutorial much appreciated.

Rob said...

A quick Thank You from me, too.

Paul said...

Ah, I love the web. You sir are a complete geezer. Saved me a lot of time figuring this out. Thank you.

Anonymous said...

Big Thx! for this.
It was easy adapting this to ARM platform.
Just needed an additional
apt-get install build-essential
and had to change coreutils_5.2.1-2_sparc.deb to coreutils__armel.deb
also i used ./configure --build=arm-linux

Anonymous said...

And so i did the 2.7.3 on the netgear NV+ just replaced the 2.6.6 to 2.7.3

Works like a charm !

TY !