FreeBSD ports加速
由于ports默認(rèn)是單線程下載的,就算你網(wǎng)絡(luò)再好,速度也很慢,根本發(fā)揮不了你高帶寬的優(yōu)勢(shì)。所以我們需要借助wget或者axel軟件來提供多線程下載。
由于我是linux用戶轉(zhuǎn)過來的,所以對(duì)wget比較熟悉。今天我們就是先用wget來加速下載。
一、安裝wget
freebsd默認(rèn)是沒有安裝wget的,所以需要我們自己安裝,命令如下。
[root@fb /etc]# whereis wget \\查找wget的位置
wget:/usr/ports/ftp/wget
[root@fb /etc]# cd /usr/ports/ftp/wget
[root@fb /usr/ports/ftp/wget]# make install clean \\編譯安裝wget,由于是工具,所以我們沒必要加什么參數(shù),默認(rèn)就可以了。
安裝完成以后,在用whereis wget 查找下
[root@fb /usr/ports/ftp/wget]# whereis wget
wget: /usr/local/bin/wget /usr/local/man/man1/wget.1.gz /usr/ports/ftp/wget
就會(huì)發(fā)現(xiàn)已經(jīng)有wget的執(zhí)行文件了。到此wget安裝完成
二、讓ports調(diào)用wget下載工具。
是用你熟悉的文本編輯器修改/etc/make.conf,修改后內(nèi)容如下
[root@fb /usr/ports/ftp/wget]# cat /etc/make.conf
# added by use.perl 2009-12-08 05:34:56
PERL_VERSION=5.8.9
FETCH_CMD=wget -c -t 1
DISABLE_SIZE=yes
wget -c參數(shù)的含義是斷點(diǎn)續(xù)傳功能打開,-t 是重試連接次數(shù)。
如果你要讓wget穿透代理服務(wù)器,需要加上以下兩行
FETCH_ENV=http_proxy=http://proxy.isadba.com:3128 \\http代理
FETCH_ENV=ftp_proxy=http://proxy.isadba.com:3128 \\ftp代理
\\proxy.isadba.com 是代理服務(wù)器 3128是端口
使用axel 下載,由于axel是支持多線程下載的工具,所以下載速度會(huì)比wget好些。
一、安裝axel
[root@fb ~]# whereis axel
axel: /usr/ports/ftp/axel
[root@fb ~]# cd /usr/ports/ftp/axel/
[root@fb /usr/ports/ftp/axel]# make install clean
二、修改/etc/make.conf
FETCH_CMD=axel -n 10
如果你要讓axel穿透代理服務(wù)器,需要加上以下兩行
FETCH_ENV=http_proxy=http://proxy.isadba.com:3128 \\http代理
FETCH_ENV=ftp_proxy=http://proxy.isadba.com:3128 \\ftp代理
完成以上工作后,你可以嘗試在使用ports安裝軟件,速度應(yīng)該會(huì)快很多。
【編輯推薦】