无法更新 Macports(使用 Mac OS X Mavericks)

Posted

技术标签:

【中文标题】无法更新 Macports(使用 Mac OS X Mavericks)【英文标题】:Can't update Macports (with Mac OS X Mavericks) 【发布时间】:2013-11-06 11:45:27 【问题描述】:

将 Mac OS X 升级到最新版本 Mavericks 后,我尝试自我更新我的 Macports,但失败了:

$ sudo port -v selfupdate
--->  Updating MacPorts base sources using rsync
receiving file list ... done

sent 36 bytes  received 69 bytes  210.00 bytes/sec
total size is 4925440  speedup is 46908.95
receiving file list ... done

sent 36 bytes  received 76 bytes  74.67 bytes/sec
total size is 512  speedup is 4.57
MacPorts base version 2.2.0 installed,
MacPorts base version 2.2.1 downloaded.
--->  Updating the ports tree
Synchronizing local ports tree from rsync://rsync.macports.org/release/tarballs/ports.tar
receiving file list ... done

sent 36 bytes  received 70 bytes  70.67 bytes/sec
total size is 57702400  speedup is 544362.26
receiving file list ... done

sent 36 bytes  received 77 bytes  75.33 bytes/sec
total size is 512  speedup is 4.53
receiving file list ... rsync: change_dir "tarballs/PortIndex_darwin_13_i386" (in release) failed: No such file or directory (2)
done

sent 4 bytes  received 9 bytes  26.00 bytes/sec
total size is 0  speedup is 0.00
rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-42/rsync/main.c(1400) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/PortIndex_darwin_13_i386/PortIndex /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 23
--->  MacPorts base is outdated, installing new version 2.2.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

checking build system type... x86_64-apple-darwin13.0.0
checking host system type... x86_64-apple-darwin13.0.0
checking target system type... x86_64-apple-darwin13.0.0
checking MacPorts version... 2.2.1
checking for sw_vers... /usr/bin/sw_vers
checking for defaults... /usr/bin/defaults
checking for xcode-select... /usr/bin/xcode-select
checking Mac OS X version... 10.9
checking Xcode location... /Applications/Xcode.app/Contents/Developer
checking Xcode version... 5.0.1
checking for gcc... /usr/bin/cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
<snip>
checking CommonCrypto/CommonDigest.h presence... yes
checking for CommonCrypto/CommonDigest.h... yes
checking for readline in -lreadline... yes
checking whether rl_username_completion_function is declared... no
checking whether rl_filename_completion_function is declared... yes
checking whether rl_completion_matches is declared... yes
checking whether username_completion_function is declared... yes
checking whether filename_completion_function is declared... yes
checking whether completion_matches is declared... yes
checking for Tcl configuration... configure: error: Can't find Tcl configuration definitions
Command failed: cd /opt/local/var/macports/sources/rsync.macports.org/release/tarballs/base && CC=/usr/bin/cc OBJC=/usr/bin/cc ./configure --prefix=/opt/local --with-tclpackage=/Library/Tcl --with-install-user=root --with-install-group=admin --with-directory-mode=0755 --enable-readline && make SELFUPDATING=1 && make install SELFUPDATING=1
Exit code: 1
Error: Error installing new MacPorts base: command execution failed
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed
$

如果我只是尝试升级特定端口,它也会失败:

$ sudo port upgrade emacsapp
Password:
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
Error: emacsapp is not installed
$ sudo port search emacs
Password:
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
$ sudo port upgrade emacs-app
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
--->  Fetching archive for gperf
--->  Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://packages.macports.org/gperf
--->  Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://lil.fr.packages.macports.org/gperf
--->  Attempting to fetch gperf-3.0.4_2.darwin_13.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/gperf
--->  Fetching distfiles for gperf
--->  Attempting to fetch gperf-3.0.4.tar.gz from http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/gperf
--->  Verifying checksums for gperf
--->  Extracting gperf
Error: org.macports.extract for port gperf returned: command execution failed
Please see the log file for port gperf for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_gperf/gperf/main.log
Error: Problem while installing gperf
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
$

任何想法

如果这是由 OS X Mavericks 和 Macports 之间的不兼容引起的? 如何解决?

编辑:

我尝试将另一台计算机从 10.8.5 升级到 10.9,然后尝试为 macports 进行 selfupdate,它再次无法正常工作,但出现了不同的错误:

$ sudo port -v selfupdate
--->  Updating MacPorts base sources using rsync
receiving file list ... done
base.tar

sent 13396 bytes  received 10355 bytes  15834.00 bytes/sec
total size is 4925440  speedup is 207.38
receiving file list ... done
base.tar.rmd160

sent 64 bytes  received 635 bytes  1398.00 bytes/sec
total size is 512  speedup is 0.73
MacPorts base version 2.2.1 installed,
MacPorts base version 2.2.1 downloaded.
--->  Updating the ports tree
Synchronizing local ports tree from file:///opt/local/var/macports/sources/svn.macports.org/trunk/dports/
svn: E155036: Please see the 'svn upgrade' command
svn: E155036: Working copy '/opt/local/var/macports/sources/svn.macports.org/trunk/dports' is too old (format 10, created by Subversion 1.6)
Command failed: /usr/bin/svn update --non-interactive /opt/local/var/macports/sources/svn.macports.org/trunk/dports
Exit code: 1
Error: Synchronization of the local ports tree failed doing an svn update
Error: Couldn't sync the ports tree: Synchronization of 1 source(s) failed
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: /opt/local/bin/port: port selfupdate failed: Couldn't sync the ports tree: Synchronization of 1 source(s) failed

【问题讨论】:

trac.macports.org/wiki/Migration 很好的建议 - 对我有用 【参考方案1】:

有一个实际的错误

gperf @3.0.4:错误:预期的参数声明符

谢天谢地,这个问题在 MacPorts ticket 40918 有自己的票

如果有任何内容,您可以在 http://trac.macports.org/wiki/MavericksProblems 阅读 Mavericks 中的所有问题

【讨论】:

【参考方案2】:

我answered 一个类似的问题。 Tcl 框架的位置发生了变化,破坏了现有的 MacPorts 基础设施。 Mavericks 的 2.2.1 安装程序现已可用here。列出您已安装的端口,并考虑在安装之前删除/opt/local。无论如何,您可能需要“更新”所有内容。

【讨论】:

安装了 2.2.1,一切又开始工作了。不必删除任何东西。谢谢你的指点。 这里也一样。这是正确的答案。是的,很多人不安装命令行工具,但这显然不是这里的问题,正如提供的第一个跟踪所示。 这确实是正确的,幸运的是我在其他地方的其他误导性答案之后不久就找到了这个答案。谢谢。 macosx 没有预装 tcl,是吗?【参考方案3】:

先安装“命令行工具”:

sudo xcode-select --install

(有时需要通过“sudo xcodebuild -license”明确同意许可)

然后升级端口:

sudo port -v selfupdate

【讨论】:

值得注意的是,您可能应该通过以下方式同意条款和条件: sudo xcodebuild -license 。完成这些步骤并输入“同意”并回车。 如果你不这样做,当你运行 selfupdate 时,一些端口会失败。 至少对我来说,无需询问,许可协议就会弹出。 这非常准确。谢谢!! 截至 2014 年 4 月 26 日。这些命令不再有效。也许应该从developer.apple.com/downloads/index.action# 下载“OS X Mavericks 命令行工具”并安装它。【参考方案4】:

我主要想对@Brett 上面的回答发表评论(抱歉,SO n00b 仍然是不允许的)并分享我的升级经验......不是真正的新答案,但希望有一些有用的信息。

我如上所述下载并安装了 Mavericks MacPorts 安装程序,(但没有删除 /opt,正如@King Julian 建议的那样,self update 很好,然后upgrade outdated 似乎正在卸载并重新安装所有我的端口带有一条消息:

Warning: Deactivate forced.  Proceeding despite dependencies.

每一个。幸运的是,我复制了 etcapache2/conf 目录,所以当它最终完成时应该能够取回我的配置......大约 30 分钟后报错

Unable to open port: extra characters after close-quote

所以我又做了一次self updateupgrade outdated 似乎又跑了……

所以看起来可以完成(无论如何,LAMP 都在工作) - 从头开始​​可能会更快,但请确保您至少有几个小时的空闲时间(并连接到主电源; )

如果信息过多,请见谅,但希望对您有所帮助!

【讨论】:

【参考方案5】:

我遇到了同样的问题。我假设您之前安装了 Xcode 命令行工具。只需启动 XCODE 并让它完成配置。现在重新运行端口命令,它应该可以正常工作了。

【讨论】:

【参考方案6】:

问题似乎与 Macports 和 Tcl 框架的位置以及安装 Xcode 后的路径有关。我建议在这里为 Mavericks 安装新版本的 Macports:http://www.macports.org/install.php

【讨论】:

【参考方案7】:

我在 Mountain Lion 上遇到了这个问题,这实际上与 MacPorts 查看旧的 XCode 路径有关(我安装了多个版本,包括安装了 betas)。我使用 -d 选项运行并检查了 /opt/local/var/macports/sources/rsync.macports.org/release/base 的 config.log 文件,它报告了一些错误:-

--- snip ---
...
configure:3331: checking for C compiler version
configure:3340: gcc --version >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
configure:3351: $? = 0
configure:3340: gcc -v >&5
Configured with: --prefix=/Applications/Xcode5-DP3.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
xcrun: Error: could not stat active Xcode path '/Applications/Xcode5-DP3.app/Contents/Developer'. (No such file or directory)
...
--- snip ---

所以我给了它正确的路径:-

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

然后就解决了。

我的线索来自this useful page。

【讨论】:

【参考方案8】:

我在 selfupdate 时遇到错误,并通过从 http://www.macports.org/install.php 重新安装 MacPorts 解决了它。现在我可以正常运行 selfupdate 命令并安装其他端口了。

我看到的错误如下,似乎与 Yo Sophia 指出的问题相同:

$ sudo port selfupdate
Password:
--->  Updating MacPorts base sources using rsync
MacPorts base version 2.1.3 installed,
MacPorts base version 2.2.1 downloaded.
--->  Updating the ports tree
--->  MacPorts base is outdated, installing new version 2.2.1
Installing new MacPorts release in /opt/local as root:admin; permissions 0755; Tcl-Package in /Library/Tcl

Error: /opt/local/bin/port: port selfupdate failed: Error installing new MacPorts base: command execution failed

【讨论】:

【参考方案9】:

您可能没有同意 XCode 许可。 如果 xcode-install 没有帮助,您可以运行以下命令以同意 Xcode 许可证。 sudo xcodebuild -license

【讨论】:

以上是关于无法更新 Macports(使用 Mac OS X Mavericks)的主要内容,如果未能解决你的问题,请参考以下文章

无法在 Mac OS X 上启动 mysql 得到 mysql.sock 连接错误

Mac OS X 更新后损坏的 python

mac os x 无法使用home brew 安装php

在 Mac OS X 上启动 MySQL 的问题

在不安装 Xcode 的情况下将 GCC 安装到 Mac OS X Leopard

如何在mac OS X下安装Mongodb