我一直在尝试安装一些端口( wget,autoconf,coreutils,.等等)但这似乎是不可能的!下面是我一步一步地做的事情:
我正在使用OSX10.9.1小牛,我已经从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
我想(当然是谷歌搜索),这肯定是因为我还没有更新macport。然后,我尝试使用“使用: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地址施加的限制和制裁造成的,而我的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服务器,并用本地主机链接替换了HTTP。
一切似乎都好通过使用
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 1,一切都会回到原来的方式(所有错误、所有消息等等)。
如果我不恢复并继续使用我放置在本地主机上的文件(或者使用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.我搜索并阅读了几乎所有建议的解决方案,但没有一个解决方案奏效,我真的被困在了这个问题上:
任何新的解决方案都是非常感谢的。
发布于 2014-01-01 11:46:21
没有回答,我自己找到了解决办法!
通过代理服务器重定向RSYNC请求的唯一方法是通过L2TP VPN连接(而不是PPTP )进行隧道。这是使Macports在代理服务器后面工作的唯一方法。
希望这能帮助其他被这种奇怪的连接方法困住的人。
发布于 2014-01-04 10:23:08
您可以使用MacPorts列表中的替代rsync镜像,而不是主要的MacOSForge镜像(由MacOSForge赞助,由苹果运行,因此受美国法律和对伊朗的出口限制所约束)。
如果没有一个rsync镜像适合您,也可以阅读这个问题的FAQ条目:http://trac.macports.org/wiki/FAQ#selfupdatefails。
https://stackoverflow.com/questions/20866704
复制相似问题