FreeBSD更换国内源

安装后第一件事就是更换国内源,不然后面安装桌面等没用国内源太慢。

修改 pkg 源

mkdir -p /usr/local/etc/pkg/repos
ee /usr/local/etc/pkg/repos/FreeBSD.conf

# content of FreeBSD.conf
FreeBSD:{
    url: "pkg+http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly",
}

#完成后,可以pkg install axel试试效果(axel下面修改ports源时里面会用的的一个小工具)
如果没安装成功,从提示上看是系统时间跟网站时间不一致,比如我是19年10月30日23:30,你根据你的时间更改运行date命令调整系统时间:date 1910302330
之后再次安装axel,应该就可以成功了。

修改 portsnap 源

ee /etc/portsnap.conf

# content of porsnap.conf
SERVERNAME=porsnap.tw.freebsd.org

#之后运行 portsnap fetch,获取或更新ports架构;
因为是第一次用portsnap,之后还需要:portsnap extract
之后portsnap update;
以后更新ports,就直接portsnap fetch update就可以了。

修改 ports 源

ee /etc/make.conf

# content of make.conf
FETCH_CMD=axel -n 30 -a   #-n 30 表示使用30个线程下载
DISABLE_SIZE=yes
MASTER_SITE_OVERRIDE?=http://mirrors.ustc.edu.cn/freebsd-ports/distfiles/${DIST_SUBDIR}/

#安装ports升级工具portmaster试试效果:
# cd /usr/ports/ports-mgmt/portmaster
# make install clean
 
##portmaster是ports的升级工具,使用基本上就用:
portmaster -a



 

猜你喜欢

转载自www.cnblogs.com/liujingli1986/p/11774738.html
今日推荐