I have installed FreeBSD 9 and I need to install phantomjs. It is available in /usr/ports/lang/phantomjs but the version is 1.0 while I need a more recent version. There is a patch to update to version 1.4.1 but I don't know how to apply this patch. I've googled this and read the FreeBSD Porter's Handbook several times but I'm still lost.

Also there is no entry about phantomjs in /usr/ports/UPDATING file.

Thanks for your help.


You need to update your port tree. Run:

portsnap fetch update

If you want to keep your port tree updated on a regular basis you can create a periodic script.
This is the script I use on my dev machine, /usr/local/etc/periodic/weekly/910.portsnap

#!/bin/sh -

# If there is a global system configuration file, suck it in.
if [ -r /etc/defaults/periodic.conf ]
    . /etc/defaults/periodic.conf

case "$weekly_portsnap_enable" in
        echo ""
        echo "Updating ports tree via portsnap:"

        portsnap cron update | grep -v /;;

    *)  rc=0;;

exit $rc

Don't forget to chmod+x 910.portsnap and add weekly_portsnap_enable="YES" to your /etc/periodic.conf file.

  • 1
    If ever anyone is interested in running phantomjs 1.6.1, intructions provided at code.google.com/p/phantomjs/issues/detail?id=597#c1 works perfectly with FreeBSD9 and clang. Unfortunately, you'll have to build by hand, as port tree only contains version 1.4, which the subbject of the question. – user130370 Aug 3 '12 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.