Forcing a recompilation of an installed port without uninstalling

Ryan Schmidt ryandesign at macports.org
Mon Jan 19 22:08:42 PST 2015


On Jan 19, 2015, at 5:17 AM, René J.V. Bertin wrote:

> I've asked this in the past because I also have run into this. It seems there's the idea that `port install -f` should do what we want, but it's never done that to me.

"sudo port -n upgrade --force" is the invocation you're looking for. "--force" forces the upgrade, even if MacPorts thinks the port is up to date while "-n" prevents MacPorts from doing the same to all the dependencies.

Single-dash single-letter flags like "-f" are "global" and have no effect unless placed after the word "port" and before the command verb (e.g. "sudo port -f uninstall"). Double-dash multiple-letter flags like "--force" are specific to the command verb in question, so they must be placed after the command verb and before any subsequent arguments (e.g. "sudo port -n upgrade --force").

This distinction is fairly non-intuitive and unhelpful in my opinion, especially when we have a global "-f" force flag and an upgrade-specific "--force" flag, but it's the way things are right now.



More information about the macports-dev mailing list