FreeBSD局域网内升级Ports Tree及Port的安装


局域内的FreeBSD系统可以使用以下步骤更新你们的Ports Tree和安装Port

以下步骤假设你在安装FreeBSD下已经安装了Ports
1、修改/etc/make.conf,如果没有自己创建
        MASTER_SITE_OVERRIDE= 
                ftp://freebsd.csie.nctu.edu.tw/pub/FreeBSD/ports/distfiles/ 
                ftp://ftp.hk.freebsd.org/pub/FreeBSD/ports/distfiles/ 
                ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/distfiles/
        FETCH_ENV=HTTP_PROXY=http://10.67.127.222:808 #针对fetch设proxy
        FETCH_ENV=FTP_PROXY=http://10.67.127.222:808  #针对fetch设proxy
2、安装proxychains
        cd /usr/ports/net/proxychains
        make install clean
3、配置proxychains
        ee /usr/local/etc/proxychains.conf

        dynamic_chain
        chain_len = 1
        quiet_mode
        tcp_read_time_out 15000
        tcp_connect_time_out 10000
        [ProxyList]
        http    10.67.127.222 808


4、cvsup (cvsup的配置文件设置就不提了) 
        proxychains cvsup -g -L 2 ports-supfile



加速ports安装时的下载速度
可以使用wget、prozilla、axel来加速ports的下载,其中后两者是多线程的,默认4条线
对于wget
FETCH_CMD=proxychains wget
FETCH_BEFORE_ARGS= -t 1
FETCH_AFTER_ARGS=
DISABLE_SIZE=yes
也可以使用
FETCH_ENV=http_proxy=http://10.67.127.222:808
FETCH_ENV=ftp_proxy=http://10.67.127.222:808

对于prozilla
需要手工修改源代码,否则遇到找不到文件时需要按任意键
将main.c中的getch()一行去掉,www.freebsdchina.org中有说
/*    do
   {
        delay_ms(20);
   }
    while (getch() == ERR);
*/
make.conf中
FETCH_CMD=proxychains proz -r -t=1 -f --timeout=15
DISABLE_SIZE=yes
同样也可以使用wget中提到的可选代理方式

对于axel
FETCH_CMD=proxychains axel
FETCH_BEFORE_ARGS= -a
FETCH_AFTER_ARGS=
DISABLE_SIZE=yes
可选代理方式与wget相同
 



« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3