无法更新 Macports 端口树

问题描述 投票:0回答:3

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

我使用的是 OS X 10.9.1 Mavericks,并且我已使用安装包 (.pkg) 从 macports 网站下载并安装了 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 地址施加的限制和制裁造成的,顺便说一句,该地址目前来自伊朗(我发现这是因为我什至无法在不使用代理服务器) !我使用以下 URL 中的说明重新路由连接并使 Macports 通过代理服务器进行连接:

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

上面的指令尝试使用 HTTP 上的 .tar.gz 存档连接并获取端口树!我不再遇到该连接错误,但遇到了一些

Could not access the file
错误,因此我手动下载了该文件,在本地设置了 Apache Web 服务器,并将该 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 synchronization updates macports
3个回答
0
投票

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

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

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



0
投票

我最近在中国旅行时也遇到了这个问题。您还可以通过编辑来规避此问题

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

更改以下代理地址,它应该可以工作。

proxy_http               proxy1:12345
proxy_https              proxy2:67890
proxy_ftp                proxy3:02139
proxy_rsync              proxy4:11377

这里我复制一下这个文件中的备注以供参考:

覆盖代理相关的环境变量。默认情况下,MacPort 从环境中的 proxy_* 选项获取代理设置 下面,以及网络首选项中,按此顺序。如果设置为 “是”,MacPorts 使用 proxy_*,然后使用网络首选项,然后使用 环境。 (请注意,网络首选项没有设置 对于 rsync 代理。另请注意 sudo(8) 会清理其环境 Mac OS X 10.5 及更高版本,因此可能必须配置为通过所需的 MacPorts 的变量。)

#proxy_override_env 否

© www.soinside.com 2019 - 2024. All rights reserved.