Say I have the following outdated packages:

  • foo
  • bar
  • baz

I want to update as many as them as possible, so I try to run:

sudo port -n -f upgrade outdated

However this fails with:

Error: org.macports.build for port foo returned: command execution failed
Please see the log file for port foo for details: ...

How can I make macports try to upgrade bar and baz, if foo fails?

I would like to generally make macports try to install/upgrade other ports if installing/upgrading some of them fails and just continue.

From the man page:

 -f       force mode (ignore state file)


 -n       don't upgrade dependencies (affects upgrade and install)

Edit: foo, bar & baz, are 3 total unrelated ports, that doesn't depend on each other in any way.

Edit 2: Next time I run this the outdated ports might be a, b & c, instead of foo, bar & baz, so I can't hardcode the failing ones and I can't just do:

sudo port update foo
sudo port update bar
sudo port update baz

The -p seems to work for me.

From the manpage:

-p       Despite any errors encountered, proceed to process multiple
         ports and commands.
  • But see the caution from a MacPorts dev below.... Using this flag is not recommended! – jvriesem Sep 17 '18 at 17:11

MacPorts dev here; the correct answer to your question is: you don't.

There is a reason why MacPorts doesn't attempt to install a package when a dependency fails to build.

This exact question has been discussed on the macports-users mailing list not so long ago:

  • 1
    foo, bar & baz, are 3 total unrelated ports, that doesn't depend on each other in any way. – Tyilo Oct 6 '12 at 12:36
  • 1
    In that case you can always update them manually, i.e. sudo port upgrade baz, sudo port upgrade bar, sudo port upgrade foo. – Clemens Lang Oct 6 '12 at 15:55
  • see "edit 2" in question. – Tyilo Oct 6 '12 at 20:27
  • This should be the correct answer, if a MacPorts dev is speak to it. – jvriesem Aug 29 '16 at 22:08
  • This could be an acceptable answer if MacPorts wouldn't be anything but stable. Unfortunately, many packages depend on a lot of optional things not really needed in most cases and every second upgrade of ports fails because macports is a bunch of unstable crap. – Bachsau Apr 14 '18 at 16:17

You can also specify "outdated and not foo" in the upgrade command, rather than just "outdated".

  • see "edit 2" in question. – Tyilo Oct 6 '12 at 20:28

Considering an old closed ticket, a defect that was fixed:

333 (dependancy failure are ignored and port continues to try and install) – MacPorts

If I understand correctly: to continue following a failure may, in some cases, be defective.

In other words:

  • it's proper (least risky) to not continue.

Postscript: I was too lazy to read the man page in its entirety (not found by the Help menu of Terminal, but that's no excuse). Following advice from someone in irc://irc.freenode.net/#macports I decided to leave this answer.

enter image description here

I never realised the -p option. Thanks to Tyilo.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.