Luckily, though, someone created some good instructions on how to install PhantomJS on those operating systems, and then, another person took those instructions and made them into a nice and easy PhantomJS install script for Debian and Ubuntu.
I haven't tried it yet on Ubuntu, but I've already installed PhantomJS with it on Debian 7. And it works without a hitch.
Here is how to install PhantomJS with this easy install script. You can preface all commands with sudo if you have sudo installed. Otherwise, do this with root privileges.
- Open a command prompt and go to a directory where you want to do this. I chose /tmp
- Run wget gist.github.com/talpa/16db1b8cfd3148364e19 to download the install script.
- Run chmod +x install_phantomjs.sh to make the script executable.
- Then run ./install_phantomjs.sh to run the install script.
The script will then run and then you will have PhantomJS on your system.