首页 > 解决方案 > 如何在不进行迁移的情况下卸载 macports?

问题描述

我目前正在使用 MacOS High Sierra 10.13.5。我想在我的 macbook 上卸载 MacPorts。

根据此处的说明:

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

我应该做以下事情

$ sudo port -fp uninstall installed

这是我看到的回复:

Error: Current platform "darwin 17" does not match expected platform "darwin 16"
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"
Error: /opt/local/bin/port: Failed to initialize MacPorts, OS platform mismatch

我真的需要在卸载之前先进行迁移吗?现在有办法直接安装吗?

标签: macosmacports

解决方案


虽然绝大多数文件都安装在或中/opt/local,但也有一些端口将文件安装在其他位置,例如由于操作系统要求。根据您是否安装了此类端口,Ken ( https://stackoverflow.com/a/50670316/2127896 ) 的解决方案可能会留下一些文件。/Applications/MacPorts/Library/LaunchDaemons/org.macports.*

如果您想确保捕获所有文件,请按照MacPorts 迁移说明进行操作,直到第 3 步,即基本上重新安装 MacPorts 基础(例如通过运行安装程序)。这应该只需要几分钟。

然后,按照https://guide.macports.org/#installing.macports.uninstalling,即运行

$ sudo port -fp uninstall installed

然后是rm -rf肯的回答中已经提到的命令。


推荐阅读