博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

解决安装macports,不能更新的问题

Posted on 2012-12-02 02:39  浪端之渡鸟  阅读(8656)  评论(0编辑  收藏  举报
执行命令 sudo port -v selfupdate,出现超时

68-245-171-115:var fanshulin$ sudo port -v selfupdate

Password:
--->  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/rsync-42/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: /opt/local/bin/port: port selfupdate failed: Error synchronizing MacPorts sources: command execution failed

 

解决方法如下:

1.搜索到了官网的连接,http://trac.macports.org/ticket/36256,根据指引到达了

http://trac.macports.org/wiki/howto/PortTreeTarball

 

2.看到如下说明:

Configuration

Edit $prefix/etc/macports/sources.conf, comment out the rsync entry, and add a new entry as follows:

#rsync://rsync.macports.org/release/ports/ [default]
http://www.macports.org/files/ports.tar.gz [default]

 

直接编辑source.conf 是不行的,拷贝到桌面记事本打开

添加上上去,如下:

//rsync://rsync.macports.org/release/tarballs/ports.tar [default]

#rsync://rsync.macports.org/release/ports/ [default]

http://www.macports.org/files/ports.tar.gz [default]

 

3.把这个文件拷贝覆盖

 

4. sudo port -v selfupdate

 

5.正常更新,21M的包,如下:

68-245-171-115:var fanshulin$ sudo port -d sync

Password:

Warning: /opt/local/etc/macports/sources.conf specifies invalid source '//rsync://rsync.macports.org/release/tarballs/ports.tar [default]', ignored.

DEBUG: Copying /Users/fanshulin/Library/Preferences/com.apple.dt.Xcode.plist to /opt/local/var/macports/home/Library/Preferences

--->  Updating the ports tree

Synchronizing local ports tree from http://www.macports.org/files/ports.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

                                 Dload  Upload   Total   Spent    Left  Speed

100 21.5M  100 21.5M    0     0  32451      0  0:11:36  0:11:36 --:--:-- 81848

 

问题解决,xxoo,路还很长啊,我本是要装opencv的。