Skip to content

Instantly share code, notes, and snippets.

@miklobit
Forked from ManuelTS/install_phantomJs.sh
Created February 16, 2018 12:06
Show Gist options
  • Select an option

  • Save miklobit/3542cf3cab0025094858887bba3901ab to your computer and use it in GitHub Desktop.

Select an option

Save miklobit/3542cf3cab0025094858887bba3901ab to your computer and use it in GitHub Desktop.

Revisions

  1. Manuel T. Schrempf renamed this gist Sep 28, 2017. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. Manuel T. Schrempf revised this gist Sep 28, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install_phantom.sh
    Original file line number Diff line number Diff line change
    @@ -34,4 +34,4 @@ 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
    phantomjs --version
    echo "Installed PhantomJS version:" && phantomjs --version
  3. Manuel T. Schrempf revised this gist Sep 28, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install_phantom.sh
    Original file line number Diff line number Diff line change
    @@ -34,3 +34,4 @@ 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
    phantomjs --version
  4. Manuel T. Schrempf created this gist Sep 28, 2017.
    36 changes: 36 additions & 0 deletions install_phantom.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    #!/usr/bin/env bash
    # This script installs PhantomJS on your Debian/Ubuntu System
    #
    # Taken from https://gist.github.com/julionc/7476620#gistcomment-2030572 and changed the download directory
    #
    # 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 /tmp/
    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