Skip to content

Instantly share code, notes, and snippets.

@jeanlescure
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save jeanlescure/28a1ddeae5b4383d0cee to your computer and use it in GitHub Desktop.

Select an option

Save jeanlescure/28a1ddeae5b4383d0cee to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
PHANTOM_VERSION="phantomjs-1.9.8"
ARCH=$(uname -m)
if ! [ $ARCH = "x86_64" ]; then
ARCH="i686"
fi
PHANTOM_JS="$PHANTOM_VERSION-linux-$ARCH"
sudo apt-get update
sudo apt-get install -y build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev
cd ~
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment