Installing MacPorts

Jun 28, 2010   //   by the guru   //   Mac  //  5 Comments

MacPorts is a community initiative developed to make it easy for people like me to compile, install and upgrade software through the command-line.

Before installing it you will need to meet the following requirements:

  1. Apple’s Xcode Developer Tools (version 3.2.1 or later for Snow Leopard, 3.1.4 or later for Leopard, or 2.5 for Tiger). This software can be found at the Apple Developer Connection or on your Mac OS X installation.
  2. The X11 windowing environment. The “X11 User” package is an optional installation on your system disc for Tiger, enabled through the “Customize” button of the installer, whereas it is included by default on Leopard and Snow Leopard.

Onto the Good Stuff

Now we have got through the boring stuff we can go on and install MacPorts.

All you need to do is go to the MacPorts download page and download the dmg version for your Mac. Shimples!

Once you have installed MacPorts go to your terminal and enter the following to make sure you have the latest and most up-to-date version:

sudo port -v selfupdate

Problems?

If you find you are having problems or had problems installing you may need to uninstall MacPorts first. If you need to do so, then you need to uninstall MacPorts through terminal then delete all the prefixed files:

sudo port -f uninstall installed
sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

Once you have done this you can follow the installation again. Any problems or suggestions just drop me a comment.

5 Comments

  • [...] Me « Installing Symfony in MAMP on OS X Installing MacPorts [...]

  • [...] Installing MacPorts « Adam Stacey AKPC_IDS += "2346,";Popularity: unranked [?] [...]

  • Hi Adam,

    I constantly get this message when I try and run the selfupdate, any ideas?:

    Warning: No index(es) found! Have you synced your source indexes?
    —> Updating the ports tree
    Synchronizing local ports tree from rsync://rsync.macports.org/release/ports/
    rsync: failed to connect to rsync.macports.org: Operation timed out (60)
    rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-40/rsync/clientserver.c(105) [receiver=2.6.9]
    shell command “/usr/bin/rsync -rtzv –delete-after ‘–exclude=/PortIndex*’ rsync://rsync.macports.org/release/ports/ /opt/local/var/macports/sources/rsync.macports.org/release/ports” returned error 10
    Error: Synchronization of the local ports tree failed doing rsync
    Error: /opt/local/bin/port: port selfupdate failed: Couldn’t sync the ports tree: Synchronization of 1 source(s) failed

  • problem solved, I think the corporate firewall I was behind was causing me issues

  • Thanks for commenting and sorry for not getting back to you sooner. I’m glad you sorted things out.

Leave a comment