port selfupdate:"macPorts来源:命令执行失败"

dar*_*sky 71 macports

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

Error: /opt/local/bin/port: port selfupdate failed: Error synchronizing 
MacPorts sources: command execution failed
Run Code Online (Sandbox Code Playgroud)

我检查了我/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
Run Code Online (Sandbox Code Playgroud)

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

小智 121

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

sudo port selfupdate
Run Code Online (Sandbox Code Playgroud)

  • 这不是问题中的错误 - 他无法在防火墙后面运行自我更新 - 只需要sudo就会出现不同的错误 (7认同)

dar*_*sky 44

我在防火墙后面.尝试在不同的网络上工作.

  • 正是我的问题.公司防火墙似乎阻止了连接. (3认同)
  • 如果您无法更改不同的网络,请尝试以下两个解决方案(同时尝试这两个解决方案),它完美地解决了我的问题:1.[rvm-macports-wont-update-through-proxy](http:/ /stackoverflow.com/questions/16520919/rvm-macports-wont-update-through-proxy); 2. [RVM安装发出-无法到执行多端口的autoconf](http://stackoverflow.com/questions/17086996/rvm-install-issue-unable-to-execute-port-autoconf) (2认同)

nob*_*ody 21

没有/opt/local/bin/macports.你需要的可执行文件是/opt/local/bin/port.(端口文件在/opt/local/var/...,这是正确的.)

基于command execution failed:

  • 你可能忘了以root身份运行.
  • port叉下列程序:rsync,tclsh,openssl,tar,chmod,chown.这些是可执行的PATH吗?(/opt/local/bin也在你PATH身边吗?)

如果这没有帮助,请运行port with -dt以获取各种调试信息.这可能有助于找到问题.也许,将有趣的部分附加到您的问题中.

  • "你可能忘记了以root身份运行." 为我解决了!谢谢! (4认同)

小智 16

我遇到了同样的问题.但我习惯了这种方法.

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

/opt/local/etc/macports/sources.conf 
Run Code Online (Sandbox Code Playgroud)

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

#rsync://rsync.macports.org/release/tarballs/ports.tar [default]
https://distfiles.macports.org/ports.tar.gz [default]
Run Code Online (Sandbox Code Playgroud)

之后你可以运行:

sudo port -d sync
Run Code Online (Sandbox Code Playgroud)

它也在MacPorts.com上解释过.


小智 14

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

  • 接受许可

当然,这是除了确保运行之外的其他提示sudo port selfupdate.


小智 11

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

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


iGr*_*Dav 5

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

希望这可以帮助。

编辑:现在更喜欢使用自制软件