【问题标题】:Cannot Update Macports Port Tree无法更新 Macports 端口树
【发布时间】:2014-01-01 08:00:37
【问题描述】:

我一直在尝试安装一些端口(wget、autoconf、coreutils、...等),但这似乎是不可能的!!!这是我一步一步完成的:

我使用的是 OS X 10.9.1 Mavericks,我已经使用 macports 网站上的安装包 (.pkg) 下载并安装了 macports。我已经安装了 Xcode 5.0.2,所以我登录了我的 Apple iOS 开发者帐户,下载了command_line_tools_os_x_mavericks_for_xcode__late_october_2013.dmg 并安装了包!

当我使用 sudo port install coreutils 我收到以下错误:Error: Port coreutils not found

我想(当然还有谷歌搜索)这一定是因为我还没有更新 macports。然后我尝试使用自我更新:sudo port -v selfupdate 顺便说一句没有成功,我得到以下错误日志:

--->  Updating MacPorts base sources using rsync
rsync: failed to connect to rsync.macports.org: Operation timed out (60)
rsync error: error in socket IO (code 10) at /SourceCache/rsync/rsync42/rsync/clientserver.c(105) [receiver=2.6.9]
Command failed: /usr/bin/rsync -rtzv --delete-after rsync://rsync.macports.org/release/tarballs/base.tar     /opt/local/var/macports/sources/rsync.macports.org/release/tarballs
Exit code: 10
Error: Error synchronizing MacPorts sources: 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 synchronizing MacPorts sources: command execution failed`

根据未能连接到服务器的消息,我认为这可能是由于对我的 IP 地址施加的限制和制裁造成的,顺便说一下,该地址目前来自伊朗(我想通了,因为我什至无法直接打开 macports 网站使用代理服务器)!我使用以下 URL 中的说明重新路由连接并使 Macports 通过代理服务器连接:

http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/

上面的指令尝试使用 .tar.gz 存档通过 HTTP 连接和获取端口树!我不再遇到那个连接错误,但是我收到了一些 Could not access the file 错误,所以我手动下载了该文件,在本地设置了一个 Apache Web 服务器,并用我的 localhost 链接替换了那个 HTTP URL。

使用似乎一切都很好

sudo port -v sync 而不是sudo port -v selfupdate

日志是这样开始的:

--->  Updating the ports tree
Synchronizing local ports tree from http://localhost/ports.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 24.6M  100 24.6M    0     0  98.9M      0 --:--:-- --:--:-- --:--:-- 99.1M
x ports/
x ports/gnome/
x ports/gnome/gnofract4d/
x ports/gnome/gnofract4d/Portfile
x ports/gnome/gnofract4d/files/
x ports/gnome/gnofract4d/files/patch-setup.py.diff
x ports/gnome/gnofract4d/files/patch-win.diff
x ports/gnome/gnofract4d/files/patch-fract4d_fractconfig.py.diff
x ports/gnome/gnofract4d/files/patch-fract4d-c-imageIO.cpp.diff
x ports/gnome/libchamplain/
x ports/gnome/libchamplain/Portfile
x ports/gnome/gconf/
x ports/gnome/gconf/Portfile
x ports/gnome/goocanvas/
x ports/gnome/goocanvas/Portfile
x ports/gnome/gstreamer1-gst-libav/
.
.
.

但最后,我得到了一些错误:

.
.
.
x ports/net/daemonlogger/Portfile
x ports/net/dibbler/
x ports/net/dibbler/Portfile
x ports/net/dibbler/files/
x ports/net/dibbler/files/0-enable-prefix.patch
x ports/net/dibbler/files/1-correct-man-pages.patch
x ports/PortIndex_darwin_11_i386/
x ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.
Command failed: cd /opt/local/var/macports/sources/localhost/ports/.. && /usr/bin/tar -v -z -xf ports.tar.gz
Exit code: 1
Error: Extracting http://localhost/ports.tar.gz failed (command execution failed)
port sync failed: Synchronization of 1 source(s) failed

现在,我仍然无法安装任何端口,如果我将 /opt/local/etc/macports/sources.conf 中的默认链接恢复为原始 RSYNC 链接,一切都会恢复原状(所有错误、所有消息等......)

如果我不恢复并继续使用我放在本地主机上的文件(或使用 file:// 直接寻址文件),当我尝试安装端口时会发生以下情况(例如,使用sudo port install coreutils) :

Port extract failed: ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.
    while executing
"macports::fetch_port $path 1"
    (procedure "macports::getportdir" line 12)
    invoked from within
"macports::getportdir $source"
    (procedure "macports::getindex" line 4)
    invoked from within
"macports::getindex $source"
    (procedure "_mports_load_quickindex" line 11)
    invoked from within
"_mports_load_quickindex"
    (procedure "mportinit" line 577)
    invoked from within
"mportinit ui_options global_options global_variations"
Error: /opt/local/bin/port: Failed to initialize MacPorts, Port extract failed: ports/PortIndex_darwin_11_i386/PortIndex.quick: gzip decompression failed
tar: Error exit delayed from previous errors.

我已经谷歌搜索并阅读了几乎所有建议的解决方案,但没有一个解决方案,我真的坚持这个:(

非常感谢任何新的解决方案。

【问题讨论】:

    标签: proxy installation sync updates macports


    【解决方案1】:

    没有回复,我自己找到了解决方案!

    通过代理服务器重定向 RSYNC 请求的唯一方法是通过 L2TP VPN 连接(不是 PPTP)建立隧道。这是让 Macports 在代理服务器后面工作的唯一方法。

    希望这可以帮助其他被这种奇怪的连接方法困扰的人。

    【讨论】:

      【解决方案2】:

      您可以使用http://trac.macports.org/wiki/Mirrors 列表中的备用 rsync 镜像,而不是主 MacPorts 镜像(由 Apple 运营的 MacOSForge 赞助,因此受美国法律和对伊朗的出口限制) .

      如果 rsync 镜像都不适合您,请阅读常见问题解答条目以了解这个问题:http://trac.macports.org/wiki/FAQ#selfupdatefails

      【讨论】:

      • 顺便说一句,所有镜像都托管在 Macports.org 上,所以它们都不适合我。我想 L2TP VPN 连接是唯一可能的方法!
      • 虽然所有镜像的域都在 macports.org 以下,但这些服务器并非由 MacOSForge 运行,而是分布在全球各地,由不同的公司和个人运行。如果您可以解析 macports.org 下的 DNS 记录,您应该可以使用镜像。我很确定 lil.fr.rsync.macports.org 会为你工作。
      猜你喜欢
      • 1970-01-01
      • 2012-07-11
      • 2013-03-25
      • 1970-01-01
      • 2013-11-06
      • 2011-09-30
      • 1970-01-01
      • 2010-10-21
      • 2020-10-10
      相关资源
      最近更新 更多