Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
Install these packages needed by PhantomJS to work correctly.
sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev
Get it from the PhantomJS website.
cd ~
export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
Once downloaded, move Phantomjs folder to /usr/local/share/
and create a symlink:
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
Now, It should have PhantomJS properly on your system.
phantomjs --version
Each time I try to run
sudo tar xvjf $PHANTOM_JS.tar.bz2
, I get this error`
phantomjs-2.1.1-linux-x86_64/
phantomjs-2.1.1-linux-x86_64/examples/
phantomjs-2.1.1-linux-x86_64/examples/colorwheel.js
phantomjs-2.1.1-linux-x86_64/examples/scandir.js
phantomjs-2.1.1-linux-x86_64/examples/page_events.js
phantomjs-2.1.1-linux-x86_64/examples/loadspeed.js
phantomjs-2.1.1-linux-x86_64/examples/injectme.js
phantomjs-2.1.1-linux-x86_64/examples/render_multi_url.js
phantomjs-2.1.1-linux-x86_64/examples/server.js
phantomjs-2.1.1-linux-x86_64/examples/netlog.js
phantomjs-2.1.1-linux-x86_64/examples/pagecallback.js
phantomjs-2.1.1-linux-x86_64/examples/module.js
phantomjs-2.1.1-linux-x86_64/examples/arguments.js
phantomjs-2.1.1-linux-x86_64/examples/universe.js
phantomjs-2.1.1-linux-x86_64/examples/openurlwithproxy.js
phantomjs-2.1.1-linux-x86_64/examples/sleepsort.js
phantomjs-2.1.1-linux-x86_64/examples/modernizr.js
phantomjs-2.1.1-linux-x86_64/examples/unrandomize.js
phantomjs-2.1.1-linux-x86_64/examples/hello.js
phantomjs-2.1.1-linux-x86_64/examples/stdin-stdout-stderr.js
phantomjs-2.1.1-linux-x86_64/examples/fibo.js
phantomjs-2.1.1-linux-x86_64/examples/phantomwebintro.js
phantomjs-2.1.1-linux-x86_64/examples/echoToFile.js
phantomjs-2.1.1-linux-x86_64/examples/post.js
phantomjs-2.1.1-linux-x86_64/examples/loadurlwithoutcss.js
phantomjs-2.1.1-linux-x86_64/examples/child_process-examples.js
phantomjs-2.1.1-linux-x86_64/examples/printenv.js
phantomjs-2.1.1-linux-x86_64/examples/useragent.js
phantomjs-2.1.1-linux-x86_64/examples/rasterize.js
phantomjs-2.1.1-linux-x86_64/examples/outputEncoding.js
phantomjs-2.1.1-linux-x86_64/examples/waitfor.js
phantomjs-2.1.1-linux-x86_64/examples/serverkeepalive.js
phantomjs-2.1.1-linux-x86_64/examples/postserver.js
phantomjs-2.1.1-linux-x86_64/examples/printmargins.js
phantomjs-2.1.1-linux-x86_64/examples/version.js
phantomjs-2.1.1-linux-x86_64/examples/run-qunit.js
phantomjs-2.1.1-linux-x86_64/examples/features.js
phantomjs-2.1.1-linux-x86_64/examples/netsniff.js
phantomjs-2.1.1-linux-x86_64/examples/walk_through_frames.js
phantomjs-2.1.1-linux-x86_64/examples/printheaderfooter.js
phantomjs-2.1.1-linux-x86_64/examples/responsive-screenshot.js
phantomjs-2.1.1-linux-x86_64/examples/countdown.js
phantomjs-2.1.1-linux-x86_64/examples/detectsniff.js
phantomjs-2.1.1-linux-x86_64/examples/simpleserver.js
phantomjs-2.1.1-linux-x86_64/examples/postjson.js
phantomjs-2.1.1-linux-x86_64/examples/run-jasmine2.js
phantomjs-2.1.1-linux-x86_64/examples/run-jasmine.js
phantomjs-2.1.1-linux-x86_64/README.md
phantomjs-2.1.1-linux-x86_64/LICENSE.BSD
phantomjs-2.1.1-linux-x86_64/bin/
phantomjs-2.1.1-linux-x86_64/bin/phantomjs
bzip2: Compressed file ends unexpectedly;
perhaps it is corrupted? Possible reason follows.
bzip2: Inappropriate ioctl for device
Input file = (stdin), output file = (stdout)
It is possible that the compressed file(s) have become corrupted.
You can use the -tvv option to test integrity of such files.
You can use the `bzip2recover' program to attempt to recover
data from undamaged sections of corrupted files.
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now `