Opened 4 years ago

Closed 4 years ago

#62280 closed defect (worksforme)

uninstall MacPorts guide needs updating for zsh? zsh: no matches found: /Library/Receipts/DarwinPorts*.pkg

Reported by: kencu (Ken) Owned by:
Priority: Normal Milestone:
Component: guide Version:
Keywords: Cc:
Port:

Description (last modified by kencu (Ken))

https://guide.macports.org/chunked/installing.macports.uninstalling.html

After migrating a macOS install from Catalina to BigSur, all the ports came with it.

It is not possible to actually run "port" on the new system to uninstall the ports due to:

% port -v
Error: Current platform "darwin 20" does not match expected platform "darwin 19"
Error: If you upgraded your OS, please follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
    while executing
"mportinit ui_options global_options global_variations"

So just had to blow them all out with:

% sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

but this gives errors trying to run it on BigSur:

zsh: no matches found: /Library/Receipts/DarwinPorts*.pkg

and then

zsh: no matches found: /Library/Receipts/MacPorts*.pkg

not sure if there is a way to make zsh silently ignore the "no matches".

I edited the line manually and then the command ran through and deleted everything.

% sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/StartupItems/DarwinPortsStartup \ 
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

Change History (4)

comment:1 Changed 4 years ago by kencu (Ken)

Description: modified (diff)

comment:2 in reply to:  description Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to kencu:

https://guide.macports.org/chunked/installing.macports.uninstalling.html

After migrating a macOS install from Catalina to BigSur, all the ports came with it.

It is not possible to actually run "port" on the new system to uninstall the ports due to:

% port -v
Error: Current platform "darwin 20" does not match expected platform "darwin 19"
Error: If you upgraded your OS, please follow the migration instructions: https://trac.macports.org/wiki/Migration
OS platform mismatch
    while executing
"mportinit ui_options global_options global_variations"

So just had to blow them all out with:

Note that you don't have to do that. If you follow wiki:Migration as suggested in the error message, which guides you through installing Xcode, CLT, and MacPorts base again, your installed ports will be fine.

comment:3 Changed 4 years ago by kencu (Ken)

the point of this was to see if this command:

% sudo rm -rf \
    /opt/local \
    /Applications/DarwinPorts \
    /Applications/MacPorts \
    /Library/LaunchDaemons/org.macports.* \
    /Library/Receipts/DarwinPorts*.pkg \
    /Library/Receipts/MacPorts*.pkg \
    /Library/StartupItems/DarwinPortsStartup \
    /Library/Tcl/darwinports1.0 \
    /Library/Tcl/macports1.0 \
    ~/.macports

could be written in a way that doesn't error out if there are no matches to certain parts of it.

comment:4 Changed 4 years ago by kencu (Ken)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.