【问题标题】:port selfupdate: "macPorts sources: command execution failed"端口自我更新:“macPorts 来源:命令执行失败”
【发布时间】:2012-07-11 21:55:15
【问题描述】:

我正在尝试selfupdate 我的 Macports,但收到以下消息:

Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing 
MacPorts sources: command execution failed

我检查了我的/opt/local/bin/macports,但该目录不存在。相反,它位于/opt/local/var。会不会是这个问题?

使用-dt 运行,我得到以下信息:

[Users/user] > selfupdate
DEBUG: MacPorts sources location: /opt/local/var/macports/sources/rsync.macports.org/release/base
--->  Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Connection refused (61)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync-42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/base/ /opt/local/var/macports/sources/rsync.macports.org/release/base
Exit code: 10
DEBUG: Error synchronizing MacPorts sources: command execution failed
    while executing
"macports::selfupdate [array get global_options] base_updated"
Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

什么是错误 61?有什么想法可以解决这个问题吗?

【问题讨论】:

标签: macports


【解决方案1】:

我最近也遇到了同样的问题,忘记在root下运行命令了。如果其他人遇到问题,请务必按以下方式运行命令:

sudo port selfupdate

【讨论】:

  • 这不是问题中的错误——他无法在防火墙后面运行自我更新——如果只需要 sudo 就会出现不同的错误
【解决方案2】:

我在防火墙后面。在不同的网络上尝试过,它工作正常。

【讨论】:

  • 正是我的问题。公司防火墙似乎阻止了连接。
  • 如果您无法更改不同的网络,请尝试以下两种解决方案(两者一起尝试),它完美解决了我的问题:1.rvm-macports-wont-update-through-proxy; 2.rvm-install-issue-unable-to-execute-port-autoconf
  • 我能够为路由器的防火墙打开/启用/允许端口 873(rsync 守护进程的端口)来解决问题。
  • 大学的 eduroam 防火墙是我的问题。
【解决方案3】:

没有/opt/local/bin/macports。您需要的可执行文件是/opt/local/bin/port。 (端口文件在/opt/local/var/...,没错。)

基于command execution failed:

  • 您可能忘记了以 root 身份运行。
  • port 分叉以下程序:rsynctclshopenssltarchmodchown。 这些可执行文件在PATH 中吗? (/opt/local/bin 也在你的PATH 中吗?)

如果这没有帮助,请使用-dt 运行端口以获取各种调试信息。这可能有助于发现问题。或许可以将有趣的部分附加到您的问题中。

【讨论】:

  • 我确实以 root 身份运行。我有所有那些分叉的程序。我会按照你说的调试它。
  • "您可能忘记以 root 身份运行。"为我解决了!谢谢!
【解决方案4】:

我遇到了同样的问题。但是我后来习惯了这种方法。

转到: $prefix/etc/macports/sources.conf (我的路径是这样的)

/opt/local/etc/macports/sources.conf 

注释掉 rsync 条目,并添加一个新条目,如下所示:

#rsync://rsync.macports.org/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]

之后就可以运行了:

sudo port -d sync

MacPorts.com上也有解释。

【讨论】:

  • 我认为问题出在防火墙上。
【解决方案5】:

小牛更新:为确保安装了 XCode 命令行工具,打开终端并运行 xcode-select –-install,然后按照弹出窗口中的说明进行操作:

  • 接受许可

当然,这是对其他提示的补充,例如确保运行sudo port selfupdate

【讨论】:

  • 我得到xcode-select: error: invalid argument '–install',xcode-select 的版本是2333。
【解决方案6】:

如果其他人遇到此问题并且他们最近更新了 XCode,那么我的问题的根源是最新版本中省略了命令行工具。

通过 XCode 首选项面板打开 XCode 并安装命令行工具修复了 MacPorts 引发的此错误。

【讨论】:

    【解决方案7】:

    如果您的公司通过 rsync 阻止访问,您可以使用 http tarball。解释here

    希望这会有所帮助。

    编辑:现在更喜欢使用homebrew

    【讨论】:

      【解决方案8】:

      我也有同样的错误。这是因为网络连接被拒绝。如果您使用大学/公司 WiFi 或公共连接,防火墙将拒绝连接。

      从 -dt "rsync: failed to connect to rsync.macports.org: Connection denied (61)" 的输出中可以看出

      macports 网站上提供了一些可用的解决方法:

      1) 使用svn

      2) 如果svn也失败了,你可以试试Daily tarball

      您可以通过运行“sudo port -d sync”来测试更改

      注意:如果https失败,可以用http代替。但不建议这样做,因为您将从不安全的连接中获取数据。

      【讨论】:

      • 这是比当前更好的答案!
      【解决方案9】:

      我遇到了同样的问题。 主要问题是我的网络。因为 NETWORK 端口被阻止;

      rsync://rsync.macports.org/release/tarballs/ports.tar

      尝试使用其他网络。

      【讨论】:

      • 这对我来说是个问题。退出 corp wifi,尝试在另一个网络上运行良好
      【解决方案10】:

      对于问题仍然存在的人,也许你忘记同意 Xcode 许可证:

      # sudo xcodebuild license
      

      记得浏览并在最后输入“同意”。

      【讨论】:

        【解决方案11】:

        就我而言,问题出在 Macports 内部!我用 Macports 更新了 rsync(Apple 提供的那个是旧的),然后 Macports 无法使用它(/opt/local/bin/rsync),而是要求使用不存在(或已经存在)的 /usr/bin/rsync使用 Macports rsync 强制删除?)。我在两者之间创建了一个软链接,现在它又可以工作了。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2020-02-14
          • 1970-01-01
          • 2011-09-30
          • 2020-10-10
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多