Specify which version to install with macports

Open the way picture Open the way · Mar 8, 2011 · Viewed 10.5k times · Source

I would like to install a specific version of gdb and gcc with macports on mac os x leopard, not the last one, but the 6.8 for gdb. Is it possible?

Answer

jmathew picture jmathew · Oct 31, 2014

It is possible. It's just convoluted and tedious. It's listed in the documentation these days.

Steps

Go to macports trac and find the package you're looking for. This is the link for subversion, which is the package I'll be using in the example.

Click the PortFile Click the portfile

Click Revision Log (top right) Click the revision log

Pour through the revisions until you find the version you're looking for. Remember the revision number. Finding the version in the revision log

In this example I'm looking for version 1.7 of subversion.

With that revision number noted. You need to checkout the version of that subdirectory at that revision.

cd /tmp
svn co http://svn.macports.org/repository/macports/trunk/dports/devel/subversion --revision 106629

Then cd into the folder and run the install

cd subversion
sudo port install

Then it should become selected by default. You can check with

sudo port installed subversion
The following ports are currently installed:
  subversion @1.7.10_0 (active)
  subversion @1.8.8_0
  subversion @1.8.10_0