Skip to content

Instantly share code, notes, and snippets.

@jzcorrea
Created January 9, 2018 10:52
Show Gist options
  • Save jzcorrea/b6358acf07c3c5e6f99b9f5ac2abdacf to your computer and use it in GitHub Desktop.
Save jzcorrea/b6358acf07c3c5e6f99b9f5ac2abdacf to your computer and use it in GitHub Desktop.
Instalação do PhantomJS no Ubuntu

How to install PhantomJS on Ubuntu

Version: 2.1.1

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



cd ~
export PHANTOM_JS="phantomjs-2.1.1-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
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/bin

Now, It should have PhantomJS properly on your system.

phantomjs --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment