You are on page 1of 3

The MacPorts Project -- Download & Installation

http://www.macports.org/install.php

Getting Started
Home Installing MacPorts Available Ports Documentation Support & Development Contact Us News

Installing MacPorts
MacPorts version 2.0.4 is available in various formats for download and installation (note, if you are upgrading your Mac OS X to a new major release, see the migration info page): dmg disk images for Lion and Snow Leopard. These contain pkg installers for use with the Mac OS X Installer. This is the simplest installation procedure that most users should follow after meeting the requirements listed below. Installers for legacy platforms Leopard and Tiger are also available. In source form as either a tar.bz2 package or a tar.gz one for manual compilation, if you intend to customize your installation in any way. SVN checkout of the unpackaged sources, if you wish to follow MacPorts development. The selfupdate target of the port(1) command, for users who already have MacPorts installed and wish to upgrade to a newer release. Checksums for our packaged downloads are contained in the corresponding checksums file. Please note that in order to install and run MacPorts on Mac OS X, your system must have installations of the following components: 1. Apple's Xcode Developer Tools (version 4.1 or later for Lion, 3.2 or later for Snow Leopard, or 3.1 or later for Leopard), found at the Apple Developer Connection site, on your Mac OS X installation CDs/DVD, or in the Mac App Store. Using the latest available version that will run on your OS is highly recommended. Ensure that the optional components for command line development are installed ("UNIX Development", plus "System Tools" in newer versions, or "Command Line Support" in older ones). 2. The X11 windowing environment (A.K.A. X11 User) for ports that depend on the functionality it provides to run. The X11 User package is an optional installation on your system CDs/DVD for Tiger, enabled through the Customize button of the installer, whereas it is included by default on Leopard and newer. You can use the xorg-server port instead of Apple's X11.app if you wish.

Shortcuts
Available Downloads MacPorts FAQ Report a Bug Bug reporting Guidelines Subversion Repository MacPorts Team Becoming a Member Mac OS Forge

Mac OS X Package (.pkg) Installer


The easiest way to install MacPorts on a Mac OS X system is by downloading the dmg for Lion, Snow Leopard or Leopard and running the system's Installer by double-clicking on the pkg contained therein, following the on-screen instructions until completion. This procedure will place a fully-functional and default MacPorts installation on your host system, ready for usage. If needed your shell configuration files will be adapted by the installer to include the necessary settings to run MacPorts and the programs it installs, but you may need to open a new shell for these changes to take effect. The MacPorts selfupdate command will also be run for you by the installer to ensure you have our latest available release and the latest revisions to the Portfiles that contain the instructions employed in the building and installation of ports. After

1 of 3

4/11/2012 2:16 AM

The MacPorts Project -- Download & Installation

http://www.macports.org/install.php

installation is done, it is recommended that you run this step manually on a regular basis to to keep your MacPorts system always current: sudo port -v selfupdate At this point you should be ready to enjoy MacPorts! Type man port at the command line prompt and/or browse over to our Guide to find out more information about using MacPorts. Help is also available.

Source Installation
If on the other hand you decide to install MacPorts from source, there are still a couple of things you will need to do after downloading the tarball before you can start installing ports, namely compiling and installing MacPorts itself: 1. cd into the directory where you downloaded the package and run tar xjvf MacPorts-2.0.4.tar.bz2 or tar xzvf MacPorts2.0.4.tar.gz, depending on whether you downloaded the bz2 tarball or the gz one, respectively. 2. Build and install the recently unpacked sources: cd MacPorts-2.0.4 ./configure && make && sudo make install Optionally: cd ../ rm -rf MacPorts-2.0.4* These steps need to be perfomed from an administrator account, for which sudo will ask the password upon installation. This procedure will install a pristine MacPorts system and, if the optional steps are taken, remove the as of now unnecessary MacPorts-2.0.4 source directory and corresponding tarball. To customize your installation you should read the output of ./configure --help | more and pass the appropriate options for the settings you wish to tweak to the configuration script in the steps detailed above. You will need to manually adapt your shell's environment to work with MacPorts and your chosen installation prefix (the value passed to configure's --prefix flag, defaulting to /opt/local): Add ${prefix}/bin and ${prefix}/sbin to the start of your PATH environment variable so that MacPorts-installed programs take precedence over system-provided programs of the same name. If a standard MANPATH environment variable already exists (that is, one that doesn't contain any empty components), add the ${prefix}/share/man path to it so that MacPorts-installed man pages are found by your shell. For Tiger and earlier only, add an appropriate X11 DISPLAY environment variable to run X11-dependent programs, as Leopard takes care of this requirement on its own. Lastly, you need to synchronize your installation with the MacPorts rsync server: sudo port -v selfupdate Upon completion MacPorts will be ready to install ports! It is recommended to run the above command on a regular basis to keep your installation current. Type man port at the command line prompt and/or browse over to our Guide to find out more information about using MacPorts. Help is also available.

SVN Sources

2 of 3

4/11/2012 2:16 AM

The MacPorts Project -- Download & Installation

http://www.macports.org/install.php

If you are developer or a user with a taste for the bleeding edge and wish for the latest changes and feature additions, you may acquire the MacPorts sources through subversion. See the Guide section on installing from subversion. Purpose-specific branches are also available at the http://svn.macports.org /repository/macports/branches url. Alternatively, if you'd simply like to view the SVN repository without checking it out, you can do so via the Trac source browser.

Selfupdate
If you already have MacPorts installed and have no restrictions to use the rsync networking protocol (tcp port 873 by default), the easiest way to upgrade to our latest available release, 2.0.4, is by using the selfupdate target of the port(1) command. This will both update your ports tree (by performing a sync operation) and rebuild your current installation if it's outdated, preserving your customizations, if any.

Other Platforms
Running on platforms other than Mac OS X is not the main focus of The MacPorts Project, so remaining cross-platform is not an actively-pursued development goal. Nevertheless, it is not an actively-discouraged goal either and as a result some experimental support does exist for other POSIX-compliant platforms such as *BSD and GNU/Linux. The full list of requirements to run MacPorts on these other platforms is as follows (we assume you have the basics such as GCC and X11): Tcl (8.4 or 8.5), with threads. mtree for directory hierarchy. rsync for syncing the ports. cURL for downloading distfiles. SQLite for the port registry. GNUstep (Base), for Foundation (optional, can be disabled via configure args). OpenSSL for signature verification, and optionally for checksums. libmd may be used instead for checksums. Normally you must install from source or from an SVN checkout to run MacPorts on any of these platforms. Experimental packaging is available for the FreeBSD (.tbz package), Fedora (.rpm package) and Ubuntu (.deb package) operating systems.

Help
Help on a wide variety of topics is also available in the project Guide and through our Trac portal should you run into any problems installing and/or using MacPorts. Of particular relevance are the installation & usage sections of the former and the FAQ section of the Wiki, where we keep track of questions frequently fielded on our mailing lists. If any of these resources do not answer your questions or if you need any kind of extended support, there are many ways to contact us!

Copyright 20022012, The MacPorts Project. Hosted by Mac OS Forge. All rights reserved.

3 of 3

4/11/2012 2:16 AM

You might also like