如果沒有make.conf就創建:
cd /etc/
vi make.conf
加入下面的內容:
MASTER_SITE_FREEBSD_ORG= ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/%SUBDIR%/
MASTER_SITE_GNOME= http://mirrors.geekbone.org/gnome/%SUBDIR%/
MASTER_SITE_LOCAL= ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/%SUBDIR%/
MASTER_SITE_OVERRIDE=ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/
大功告成,這樣更新ports,就直接從中國的服務器下載了。
最後我們的ports使用axel來多線程下載,不知道axel在ports的那個位置,可以用下面指令找找:
# cd /usr/ports
# make search key=axel
Port: axel-1.0b
Path: /usr/ports/ftp/axel
Info: A download accelerator
Maint: [email protected]
B-deps: gettext-0.14.5_2 gmake-3.81_1 libiconv-1.9.2_2
R-deps: gettext-0.14.5_2 libiconv-1.9.2_2
WWW: http://wilmer.gaast.net/main.php/axel.html
其實還有一個更方便的方法就是whereis
# whereis axel
axel: /usr/ports/ftp/axel
直接開始安裝
# cd /usr/ports/ftp/axel
# make install clean
安裝完成以後,我們到make.conf進行設置,axel才能工作。
# ee /etc/make.conf
加入:
FETCH_CMD=axel
FETCH_BEFORE_ARGS= -n 10 -a
FETCH_AFTER_ARGS=
DISABLE_SIZE=yes
這樣編譯出來的程序執行效率明顯提高,呵呵。