Apple - Can't upgrade macports under Big Sur!

It turns out that the Big Sur's XCode command-line tools aren't good enough for MacPorts. You need to manually download Command Line Tools for Xcode 12.2 from https://developer.apple.com/download/more/?=command%20line%20tools


MacPorts typically uses different installers for different versions of macOS. Have you installed the MacPorts for Big Sur, or are you trying to upgrade MacPorts with a port command?

Have you seen this notice re updating MacPorts?:

% sudo port selfupdate

I don't run/haven't installed Big Sur, but I've used MacPorts for a while. MacPorts often issues a similar puzzling error after Catalina upgrades - it's puzzling until you learn what causes it. A symptom similar to the one you describe occurred after in-version and/or Xcode upgrades on Catalina (e.g. 10.15.5 to 10.15.6). The explanation, and the fix, are described here.

Hopefully, one of these will get you back on track.


This is how I solved it:

  • I've upgraded developer-tools through system update. (If this doesn't works you can do it manually from here: https://developer.apple.com/download/more/?=command%20line%20tools)
  • Then I went to macports download page: https://www.macports.org/install.php and downloaded the Big Sur version.
  • After installing Macports again (without uninstalling the current version) I've ran sudo port selfupdate and sudo port upgrade outdated.

Everything is working again.