Installing Programs

The following instructions will install programs that we have found useful. The first four commands are one-liners using apt-get install. The instructions that follow illustrate a procedure that is required when you need a different version of the software than is available by the straightforward method. We reproduce with accompanying explanatory notes the steps given in this GitHub page for installing version 0.10.25 of Node.js (which facilitates networking). Type the commands at the prompt according to your requirements and accept invitations to continue.

  1. sudo apt-get install openjdk-6-jdk
    (for the a Java Development Kit with its java and jar programs)
  2. sudo apt-get install usbmount
    (so that you can access your usb stick easily from the command line)
  3. sudo apt-get install scrot
    (for the screen shot application)
  4. sudo apt-get install sqlite3
    (for SQLite)
  5. sudo apt-get update
  6. sudo apt-get upgrade
    Be prepared for this to take a long time; allow an hour to be on the safe side.
  7. If you have installed another version of Node.js, remove it with (depending on the installation sudo apt-get remove nodejs or sudo apt-get remove node.
  8. sudo su -
    This command switches the user to root.
  9. cd /opt
    This change the directory to where Node.js will be installed.
  10. wget http://nodejs.org/dist/v0.10.25/node-v0.10.25-linux-arm-pi.tar.gz
    This downloads the required zipped archive.
  11. tar xvzf node-v0.10.25-linux-arm-pi.tar.gz
    This extracts (x) verbosely (v), the zipped (z) file (f). See this useful page for information about tar.
  12. ln -s node-v0.10.25-linux-arm-pi node
    This created the symbolic link named node to refer to node-v0.10.25-linux-arm-pi.
  13. chmod a+rw /opt/node/lib/node_modules
    This provides read/write access for all users to the node_modules folder.
  14. chmod a+rw /opt/node/bin
    This provides read/write access for all users to the bin folder.
  15. echo 'PATH=$PATH:/opt/node/bin' > /etc/profile.d/node.sh
    This puts the setting PATH=$PATH:/opt/node/bin into the shell executable file node.sh. You will be able to execute a javascript file with an instruction such as node myscript.js from any directory. Note that you still need to change directory (or supply the full pathname) to use the npm package manager for installing other packages such as socket.io and node_static.
  16. Reboot then test with the command node --version.
See also Installing Firebird and node-firebird on the Raspberry Pi. Please let us know about programs that you have found useful on your Raspberry Pi.
Programming - a skill for life!

Setting up the Raspberry Pi, installing Lazarus, use of the GPIO port (with and without PiFace), web servers and remote control