Here's how to install CasperJS on Debian LInux. It may even work on Ubuntu, but I'm not sure.

Instructions here are adapted from those found here.

During this process, you will install prerequisites which include PhantomJS, NodeJS, and npm.

  1. Install PhantomJS using this easy method.
  2. Run apt-get install curl to install the curl program.
  3. Run curl -sL deb.nodesource.com/setup | bash - to download a script which will allow you to install nodejs and npm using apt-get install.
  4. Run apt-get install nodejs to install nodejs and npm.
  5. Finally, install CasperJS by running npm install -g casperjs

Upon completion of these instructions, you will have installed PhantomJS, curl, nodejs, npm, and of course, CasperJS.