MacPort升级记:MacPorts Error:Current platform “darwin 17“ does not match expected platform “darwin 15“

本文介绍了MacPorts在操作系统升级后出现平台不匹配错误的问题及解决方案。通过重新编译安装原有版本,避免了安装最新版本导致的问题,并成功升级到了最新版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原创文章,转载注明出处。

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 升级软件就行。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值