Created
August 17, 2018 08:19
-
-
Save eyecatchup/c753235415286c9b4b88136e8dc1fbe3 to your computer and use it in GitHub Desktop.
Install PhantomJS on Debian/Ubuntu from source
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script install PhantomJS in your Debian/Ubuntu System | |
# | |
# This script must be run as root: | |
# sudo sh install_phantomjs.sh | |
# | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" 1>&2 | |
exit 1 | |
fi | |
PHANTOM_VERSION="phantomjs-2.1.1" | |
ARCH=$(uname -m) | |
if ! [ $ARCH = "x86_64" ]; then | |
$ARCH="i686" | |
fi | |
PHANTOM_JS="$PHANTOM_VERSION-linux-$ARCH" | |
apt-get update | |
apt-get -y install build-essential chrpath libssl-dev libxft-dev libfreetype6 libfreetype6-dev libfontconfig1 libfontconfig1-dev | |
cd ~ | |
wget -q https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2 -O $PHANTOM_JS.tar.bz2 | |
tar xvjf $PHANTOM_JS.tar.bz2 | |
if [ -d /usr/local/share/$PHANTOM_JS ] ; then | |
rm -rf /usr/local/share/$PHANTOM_JS | |
fi | |
mv -f $PHANTOM_JS /usr/local/share/ | |
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/share/phantomjs | |
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin/phantomjs | |
ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/bin/phantomjs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment