当前位置: 移动技术网 > 科技>操作系统>Unix > FreeBSD在安装ports时时间过长的解决方法

FreeBSD在安装ports时时间过长的解决方法

2018年03月22日  | 移动技术网科技  | 我要评论

freebsd在安装ports时缩短下载时间

方法a: 使用代理。

在/etc/make.conf中设置
fetch_env= "http_proxy=ip[:端口]"
如果需要,在fetch_env值后面加入空格,
http_proxy_auth=basic:*:user:password

方法b: 在其它机器上fetch

make fetch-recursive
...
然后将/usr/ports/distfiles拿走。


方法c:使用wget/axel加速你的port下载


以下所述功能均通过修改make.conf实现

对于wget
========
fetch_cmd= wget
fetch_before_args= -c -t 1
fetch_after_args=
disable_size=yes #这行是必要的,否则...

前面3行也可以换成
fetch_cmd=wget -c -t 1

如果你要wget穿透代理服务器,请加上下面两行
fetch_env=http_proxy=http://proxy2.zsu.edu.cn:3128
fetch_env=ftp_proxy=http://proxy2.zsu.edu.cn:3128

或者使用其他的穿越代理工具例如proxychains 或者socks5(runsocks)
则fetch_cmd=proxychains wget或者runsocks wget

什么?不知道wget是什么?那就先
cd /usr/ports/ftp/wget/
make install clean

对于axel
========
同样,也可以使用axel来替换fetch来进行多线程下载
fetch_cmd=axel
fetch_before_args= -a
fetch_after_args=
disable_size=yes
或者只写一行
fetch_cmd=axel -a

axel 穿透代理服务器的方法与wget一致

axel在/usr/ports/ftp/axel位置


添加更快的port下载站点
====================
另外,加上以下两行可以在让make先从更快的站点下载port

master_site_override= \
ftp://ftp2.tsinghua.edu.cn/mirror/freebsd/ports/distfiles/\
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/
这个是教育网的设置,公网的兄弟可以看着办啦

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网