Hola Amigos,

I have blogged about installing brew package manager previously. Today I am going to show how to install MacPorts.

What is MacPorts?

MacPorts is an open source package manager for Mac OS X. It makes fetching, compiling and installing open source packages on Mac OS X easy.

It is recommended that you use only one package manager as there can be package conflicts. But I have been using MacPorts along with brew without any problems, unless you purposefully try to break the system.

Also MacPorts depends on Xcode and xcode command line tools. You can download these from App Store or from the Apple Developers website.

You can either download xcode command line tools from Apple Developer website itself or run the following command after install Xcode:

xcode-select --install

Installing MacPorts via Installer:

To install MacPorts (stable version), you can download the dmg from here.

Users having older version of Mac OS X can visit their Download page for detailed steps.

Installing MacPorts from source:

1) Clone the MacPorts source via svn (Subversion):

Run the following command in your Terminal.App:

svn checkout https://svn.macports.org/repository/macports/trunk macports-trunk

This will fetch the source of MacPorts into a folder named ‘macports-trunk’.

You can fetch the source in another folder by running in Terminal.App:

svn checkout https://svn.macports.org/repository/macports/trunk FOLDER_NAME

Note: Replace FOLDER_NAME with your desired folder name.

Considering that our MacPorts source is cloned in macports-trunk folder

If you have already cloned the source code then run the following code inside the macports-trunk directory (in Terminal.App):

svn up

Now to compile and install MacPorts, run the following sequence of commands in Terminal.App:

./configure --enable-readline
make
sudo make install

Run the following command to update your ports (MacPorts base sources)

sudo port -d selfupdate

You can use MacPorts (interactive mode of MacPorts) by running

port

To install a package using MacPorts you can run

sudo port install package_name

Hope this helps you installing open source packages on your Mac.

Let the Windows be open, and feel the Freedom.

Advertisement

One thought on “[How To]: Installing MacPorts on Mac OS X

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s