由于ports默认是单线程下载的,就算你网络再好,速度也很慢,根本发挥不了你高带宽的优势。所以我们需要借助wget或者axel软件来提供多线程下载。8 l( ?) c: j) \! @: j
由于我是linux用户转过来的,所以对wget比较熟悉。我们就是先用wget来加速下载。
6 G* [1 e. J* \; Q5 t 由于ports默认是单线程下载的,就算你网络再好,速度也很慢,根本发挥不了你高带宽的优势。所以我们需要借助wget或者axel软件来提供多线程下载。$ F% \: v7 f b. N8 E
由于我是linux用户转过来的,所以对wget比较熟悉。我们就是先用wget来加速下载。- P. W$ E9 S0 B+ Z& y* i
freebsd默认是没有安装wget的,所以需要我们自己安装,命令如下。3 o5 `5 U1 F1 s! V) n
[root@fb /etc]# whereis wget ““查找wget的位置3 i( P4 z1 O! a+ p0 _
wget:/usr/ports/ftp/wget- u/ w! {* _. a) i
[root@fb /etc]# cd /usr/ports/ftp/wget8 v2 x! j2 U% z! Q
[root@fb /usr/ports/ftp/wget]# make install clean ““编译安装wget,由于是工具,所以我们没必要加什么参数,默认就可以了。
3 e& s& R6 r4 |5 y 安装完成以后,在用whereis wget 查找下; ^8 a u- \9 k9 h
[root@fb /usr/ports/ftp/wget]# whereis wget: I9 ?- p9 K$ m' m& J4 k L' l
wget: /usr/local/bin/wget /usr/local/man/man1/wget.1.gz /usr/ports/ftp/wget
$ D7 l+ V/ h5 b2 X4 z 就会发现已经有wget的执行文件了。到此wget安装完成
1 x O3 y! ?8 U9 R- M1 x+ X 是用你熟悉的文本器修改/etc/make.conf,修改后内容如下/ T0 @ C6 V: U" w! o
[root@fb /usr/ports/ftp/wget]# cat /etc/make.conf, o/ K+ n$ G& i9 x* t
# added by use.perl 2009-12-08 05:34:563 l3 D- w5 E: c1 L: r. C4 s0 U
PERL_VERSION=5.8.9
8 ^# k9 W- [. J/ r C FETCH_CMD=wget -c -t 1
1 a+ f6 ?0 m8 c DISABLE_SIZE=yes
+ B6 P3 S8 C& F; W& o7 Y wget -c参数的含义是断点续传功能打开,-t 是重试连接次数。
|6 e% B9 z$ O3 j; N5 w 如果你要让wget穿透代理服务器,需要加上以下两行, d) V1 c! N) Z* A
FETCH_ENV=http_proxy=http://proxy.isadba.com:3128 ““http代理1 x4 ~7 ?' V l+ r4 ~. k t3 s
FETCH_ENV=ftp_proxy=http://proxy.isadba.com:3128 ““ftp代理
/ A# a, ]2 L# w ““proxy.isadba.com 是代理服务器 3128是端口
! A0 {$ v% F# P2 J- W! B 使用axel 下载,由于axel是支持多线程下载的工具,所以下载速度会比wget好些。
/ ~! A7 u: k5 e) t [root@fb ~]# whereis axel
3 L/ q5 m0 m. a M" e axel: /usr/ports/ftp/axel' k/ {4 k/ l9 p* ]8 M
[root@fb ~]# cd /usr/ports/ftp/axel/
* s/ N' ~1 e% \: [ [root@fb /usr/ports/ftp/axel]# make install clean
0 W0 {/ y5 d4 v1 G3 p* j! P& m H FETCH_CMD=axel -n 10& f- \& C: l2 B: ~
如果你要让axel穿透代理服务器,需要加上以下两行$ w9 h! k5 N; h2 g
FETCH_ENV=http_proxy=http://proxy.isadba.com:3128 ““http代理5 [( s4 p& e1 i! G0 v# J
FETCH_ENV=ftp_proxy=http://proxy.isadba.com:3128 ““ftp代理& V; l: I* S Z- W9 T5 v
完成以上工作后,你可以尝试在使用ports安装软件,速度应该会快很多。
4 {4 K- w2 t3 k2 ? freebsd默认是没有安装wget的,所以需要我们自己安装,命令如下。6 J4 J$ B( r+ k4 s# @
[root@fb /etc]# whereis wget ““查找wget的位置7 P# \& c/ g0 @5 s! u
wget:/usr/ports/ftp/wget
& Y- ~# p: _0 Q! L& [9 N [root@fb /etc]# cd /usr/ports/ftp/wget
. {9 Q9 P$ o2 A7 T [root@fb /usr/ports/ftp/wget]# make install clean ““编译安装wget,由于是工具,所以我们没必要加什么参数,默认就可以了。
9 g# L4 }' q' P5 o2 h( j! @ 安装完成以后,在用whereis wget 查找下
7 w0 ^1 E2 O& R% E: ? [root@fb /usr/ports/ftp/wget]# whereis wget* G6 N4 f& X; {
wget: /usr/local/bin/wget /usr/local/man/man1/wget.1.gz /usr/ports/ftp/wget1 s& R, V5 G& e5 o
就会发现已经有wget的执行文件了。 |