原创文章,转载注明出处。
port对于mac的用处就略过了。
mac系统up up date,port 有一天就出现标题错误了。
Error: Current platform "darwin 19" does not match expected platform "darwin 18"
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
去 https://trac.macports.org/wiki/Migration 看一下,
A MacPorts installation is designed to work with a particular operating system and a particular hardware architecture.
This migration procedure ensures a smooth transition after major system changes, such as:
major operating system upgrades (e.g., from 10.9 Mavericks to 10.10 Yosemite).
architecture migrations (e.g., from PowerPC to Intel).
migrations from one computer to another
If you don't want to migrate, you can always uninstall MacPorts entirely before manually reinstalling ports.
Note: If you move from one Mac to another Mac using Migration Assistant, you have to do it first.
按照网络文章一般般操作,下载安装包见 https://www.macports.org/install.php,安装个最新版本后,port list installed 提示没有软件安装,这......
其他各种方法,替换,pkg最新版或次新版,都如此,难道以前装的软件废了?
废话不说了,解决方式:现有版本重新安装一下,原来我的是编译安装的,正好发现原低版本的软件还有重新编译安装,运行port就不报错了。
port -qv installed
可以列出已经按照的软件包了,之后
sudo port -v selfupdate
就可以自动升级到最新版本了。也保留了已安装软件。
报错后不要安装对应最新的版本,装了启动不了port原来安装的软件。也不能安装老的pkg,提示版本问题,只能源码编译并覆盖安装。
之后就是
sudo port upgrade outdated 升级软件就行。