跳至主要内容

Mac OSX 10.9 更新 port 症结

自从 MacBook Pro 升级到 Mavericks 之后,还没有用过 port 来更新软件。今天刚好需要安装 tmux 所以执行了 sudo port upgrade outdated 来更新所有已经过期的软件包,却发现居然报错:

--->  Configuring expat
Error: Failed to configure expat, consult /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/work/expat-2.1.0/config.log
Error: org.macports.configure for port expat returned: configure failure: command execution failed
Please see the log file for port expat for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_textproc_expat/expat/main.log
Error: Unable to upgrade port: 1
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets

谷歌了之后看到有人说需要用 XCode 安装 developer library,于是照做了一下,貌似没什么用,病症还是在升级到了 OSX 10.9 之后遇到了问题,我仔细查看了日志后发现是与 C 编译器有关的:

error: C compiler cannot create executables

貌似强大的 clang 无法找到 stdio.h ,这也……点太背了吧!!!后来又看到另一篇和 brew 有关的帖子,按照里头的建议重新安装了 command line tool

xcode-select --install


之后重新执行了 port upgrade outdated,问题解决了。StackOverflow 上也有类似的回答,有人提醒说如果刚安装好 XCode 最好要阅读并接受它的 license 先,否则还是有同样的error。

评论