我一直在尝试安装几个端口(wget,autoconf,coreutils等等),但似乎不可能!这就是我一步一步做的事情:
我正在使用OS X 10.9.1 Mavericks,我已经从macports网站使用安装包(.pkg)下载并安装了macport。我已经安装了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中的说明重新路由连接并使Macport通过代理服务器连接:
http://samkhan13.wordpress.com/2012/06/15/make-macports-work-behind-proxy/
上面的指令尝试通过HTTP使用.tar.gz存档连接并获取端口树!我没有得到那个连接错误但是我遇到了一些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链接,则一切都恢复原样(所有错误,所有消息等等)
如果我没有恢复并继续使用我放在我的localhost上的文件(或使用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.
我已经谷歌搜索并阅读了几乎所有建议的解决方案但是NONE已经解决了,我真的坚持这个:(
非常感谢任何新的解决方案。
答案 0 :(得分:0)
没有回复,我自己找到了解决方案!
通过代理服务器重定向RSYNC请求的唯一方法是隧道通过L2TP VPN连接(而不是PPTP)。这是让Macport在代理服务器后面工作的唯一方法。
希望这可以帮助那些坚持这种奇怪连接方法的人。
答案 1 :(得分:0)
而不是主MacPorts镜像(由Apple运营的MacOSForge赞助,因此受美国法律和对伊朗的出口限制约束),您可以使用{{3的列表中的备用rsync镜像}}
如果没有任何rsync镜像适合您,请阅读常见问题解答条目:http://trac.macports.org/wiki/Mirrors。