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".