Installing MacPorts on MacOS 10.15 Catalina Beta 7

Another year, another round of “Oh, shit! My software doesn’t run on the latest version of MacOS!” While MacOS steadily marches towards being a consumer friendly OS that alienates the hardcore users, we continue to try to beat back the tide with tools like MacPorts. I’ll be curious to see how things go with future versions of MacOS, now that there are reports that upgrading to Catalina will wipe out a users /opt/ folder.

Below you will find my steps for getting MacPorts compiled by hand on MacOS 10.15 Catalina. I am working on a clean install of Catalina Beta 7 and Xcode 11 beta 7. If you are trying an upgrade, or using a different version, your experience may be different. If you run into problems post a comment and I’ll do what I can to help out.

And so, without further ado…

  1. Install MacOS Catalina Beta 7
  2. Install XCode 11 Beta 7
  3. Launch XCode-beta
    1. Agree to the license agreement.
    2. Wait for it to finish installing components.
    3. Quit XCode
  4. Open a terminal window.
    (CMD-Space terminal <return>)
  5. sudo xcode-select --install
    (enter your user password)
  6. When the pop-up opens asking for permission to install the command line tools, click “Install”.
  7. Agree to the license agreement, despite what it says will happen to your first-born.
  8. Back to your terminal window, inscribe these arcane incantations:
  9. sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer
    (Once XCode leaves beta, the command will be: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer )
  10. sudo xcodebuild -license
    (Space through the document, and then type ‘agree'<return>)
  11. cd ~/Desktop
    (A window will pop up asking for access to your desktop folder. Grant it, lest the imps be released.)
  12. curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.5.4.tar.gz
  13. tar -xzvf MacPorts-2.5.4.tar.gz
  14. cd MacPorts-2.5.4
  15. ./configure
  16. make
  17. sudo make install
    (Enter your user password if prompted. You may not be prompted if you get through the above steps quickly.)
  18. echo "export PATH=/opt/local/bin:\$PATH" >> ~/.zshrc
  19. source ~/.zshrc
  20. sudo port -v selfupdate
    (Enter your user password if prompted. You may not be prompted if you get through the above steps quickly.)

At this point you are pretty much ready to start installing ports. I say pretty much, because there are two ‘optional dependencies’ that will make your life easier:

  1. Install Java from https://www.java.com/en/download/mac_download.jsp
  2. Install XQuartz X11 from https://www.xquartz.org/

OK, now you are really, really ready to install ports. 🙂

Take your fresh Catalina install out for a spin and let us know how it goes!

Custom Stickers, Die Cut Stickers, Bumper Stickers - Sticker Mule

Installing MacPorts on MacOS 10.14 Mojave

Update 10.15: If you are looking for instructions on how to install MacPorts on Catalina, try here.

Another year, another OS X update.  (Yes, I do copy a fair chunk of the text from previous year’s posts.)  I assume you are here because you downloaded the Mojave Beta/GM from Apple, and were disappointed that there isn’t a MacPorts installer yet.  While I am sure they will release it soon, perhaps we can get you over the hump so you can beat up Mojave before the official drop date.  If you are comfortable compiling software by hand, we should be able to get thru this easy-peasy.

I am doing this on a clean install of Mojave. If you are attempting an upgrade from any previous version, your process may vary in unexpected ways.  If you did an upgrade install, you will want to make sure you’ve downloaded the latest version of Xcode, and you should probably follow the MacPorts uninstall instructions so you have less cruft around that could interfere with the process.  If you have an upgrade issue, please comment here and I’ll do my best to help you out and improve the instructions.

This is my first pass at getting it running.  I’m going to share all my steps.  One or two things I do might be unnecessary, and could be removed later if I refine the process; but I promise I wouldn’t have hit the Publish button if the overall process didn’t work.

  1. Install MacOS "Mojave"
  2. Connect to the internet
  3. Install Xcode 10 from the App Store.
  4. Launch Xcode:
    1. Agree to the license.
    2. Let it install the extra components it says it needs.
    3. Quit xcode.
  5. Open a terminal window:
  6. sudo xcode-select --install
  7. When the pop-up launches, install the command line tools.
  8. cd ~/Desktop
  9. mkdir macports
  10. cd macports
  11. curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.5.3.tar.gz
  12. tar -xzvf MacPorts-2.5.3.tar.gz
  13. cd MacPorts-2.5.3
  14. ./configure
  15. make
  16. sudo make install
  17. echo export\ PATH=/opt/local/bin:/opt/local/sbin:\$PATH >> ~/.profile
  18. source ~/.profile
  19. sudo port -v selfupdate

There’s one extra step I find worth doing that isn’t strictly required for installing the MacPort installer tools.  I find it useful to install Java on my machine before I install any ports.  Otherwise you will be plagued with pop-up windows recommending you install Java while compiling ports like rsync.

At this point, you should be ready to start reinstalling your ports! Wee!

After manually installing MacPorts with the above instructions I was able to install rsync, wget, git, python27, which are my usual first validation tests.  Those packages, combined with their dependencies, result in around  75 installed packages; which does a pretty good job of verifying MacPorts is working.  🙂

Updated 2018/09/26 – Tightened up my sloppy use of a root privileged shell after barrykn called me out on it on reddit.  🙂

Updated 2018/10/02 – Fixed the smart-quote thing, so #17 should work now without needed to have the quotes tweaked. Crap! Smart quotes are back. Stupid theme updates…

Installing MacPorts on MacOS “High Sierra”

Update 10.15: If you are looking for instructions on how to install MacPorts on Catalina, try here.

Update: The official MacPorts installer is out. Go get it! https://www.macports.org/install.php

Another year, another OS X update. I assume you are here because you downloaded the High Sierra GM from Apple, and were disappointed that there isn’t a MacPorts installer yet.  While I am sure they will release it soon, perhaps we can get you over the hump so you can beat up High Sierra before the official drop date.  If you are comfortable compiling software by hand, we should be able to get thru this easy-peasy.

I am doing this on a clean install of High Sierra. If you are attempting an upgrade from any previous version, your process may vary in unexpected ways.  You will want to make sure you’ve downloaded the latest version of Xcode, and you should probably follow the MacPorts uninstall instructions so you have less cruft around that could interfere with the process.  If you have an upgrade issue, please comment here and I’ll do my best to help you out and improve the instructions.

This is my first pass at getting it running.  I’m going to share all my steps.  One or two things I do might be unnecessary, and could be removed later if I refine the process; but I promise I wouldn’t have hit the Publish button if the overall process didn’t work.

  1. Install MacOS “High Sierra”
  2. Connect to the internet
  3. Install Xcode 9 from the App Store.
  4. Launch Xcode:
    1. Agree to the license.
    2. Let it install the extra components it says it needs.
    3. Quit xcode.
  5. Open a terminal window:
  6. sudo bash
  7. xcode-select --install
  8. When the pop-up launches, install the command line tools.
  9. cd ~/Desktop
  10. mkdir macports
  11. cd macports
  12. curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.4.1.tar.gz
  13. tar -xzvf MacPorts-2.4.1.tar.gz
  14. cd MacPorts-2.4.1
  15. ./configure --enable-readline
  16. make
  17. make install
  18. echo 'export PATH=/opt/local/bin:/opt/local/sbin:$PATH' >> ~/.profile
  19. source ~/.profile
  20. port -v selfupdate

At this point, you should be ready to start reinstalling your ports! Wee!

After manually installing MacPorts with the above instructions I was able to install subversion and wget, which are my usual two first validation tests.  Subversion alone has a total of 33 dependencies alone, and combined they have 135 dependent packages; which does a pretty good job of verifying MacPorts is working.