Home > Programming > Install Port on Mac

Install Port on Mac

Eventually, get the Port installed on my Mac. Here’s the step:

Download source of port or the dmp for your mac

For Source(this is from the official Port site, just follow the step):

  1. “cd” into the directory where you downloaded the package and run “tar xjvf MacPorts-2.0.4.tar.bz2” or “tar xzvf MacPorts-2.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

Alternatively, you can also use their “dmg” disk images for Lion and Snow Leopard. It’s very simple, just double click the downloaded dmg, follow the steps 🙂

OK, then here’s my problem. When I open the terminal, my port is not there! Why? You have to update your profile.

  • Change your profile to include MacPort in the PATH, add the following

vi $HOME/.profile

#!/usr/bin/bash

# MacPort

export PATH=$PATH:/opt/local/bin

  • Don’t forget to Source your profile to include the changes, in the terminal, type:

. $HOME/.profile

 

Now, update the port:

sudo port -v selfupdate

and install packages with

sudo port install <package name>

 

By default, you port is install at

So you can do this too without update your profile:

                        sudo /opt/local/bin/port -v selfupdate


Advertisements
Categories: Programming
  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: