Monday, May 5, 2014

Install the Latest NodeJS for Raspberry Pi via apt-get

As part of our testing regime for Starless, I build the latest version of node.js from source, package it in a .deb file and push it to one of our servers. It recently dawned on me that other people might want an easy way to install the latest released version of node on their Raspberry Pi's. So here's a quick HOWTO:

Step 0 : Download Raspbian, Copy it to an SD-Card and Boot.

I'm going to assume you've done this already. If not, there are several good "getting started" guides out there. I like the one at http://elinux.org/RPi_Easy_SD_Card_Setup, personally.

Step 1 : Add the "Gonk" repository to /etc/apt/sources.list

Add the following line to the end of /etc/apt/sources.list and run `apt-get update`:

deb http://sm5.us/gonk wheezy main

Here's how I did it:

sudo -s
echo "deb http://sm5.us/gonk wheezy main" >> /etc/apt/sources.list
apt-get update

Step 2 : Un-install the older nodejs package (if installed)

At the time I wrote this, version 0.6.19 of node.js is provided by the main repo. In an ideal world, I would spend the time to make it so you don't have to uninstall the stock package, but I'm somewhat lazy, so just uninstall the stock package if it's installed.

Run the command `nodejs --version` and if you get something like v0.6.19, run these commands:

sudo apt-get remove nodejs
sudo apt-get autoremove

Step 3 : Install the nodejs-latest package

Run the command `apt-get install nodejs-latest` to get the latest released version of node from the Gonk repo:

sudo apt-get install nodejs-latest

Step 4 : Send me an email reminding me to publish the GPG key for the Gonk repo

The apt-get command will balk when you run the install command that it's an unsigned package. Surprisingly, this has less to do with me being too lazy to generate a key and more to do with me being too lazy to fix my test system to not break when I push out new, signed packages.

I'm eventually going to fix that, but if you send an email to meadhbh+fixyerbuildsystem@smithee.us, i'll probably do it sooner rather than later. (though i'm definitely going to do it before we push out an official Starless release.)

And as always, send me an email if you have questions or comments.

Saturday, May 3, 2014

everything is incremental

"everything is incremental," said the sloth to the frog, sitting in the hot tub.

"by the way, does it seem a little warmer, friend sloth?" he replied.

"yes! isn't it great!" the lobster said, jumping in the deep end of the tub. "i found the temperature switch on the tub and opened it full bore before jumping in!"

they were found the next morning beside the tub, drunken, hung-over and slightly pinkened. because it turns out a frog will eventually jump out of a gradually warming hot tub, but when he's out with his friend the lobster and the sloth, he'll drink several times his weight in sake and pass out.

but it's still true it's hard sometimes to see small incremental changes over time.