備份源文件
root@localhost:/ # cd /etc/pkg/
root@localhost:/etc/pkg # cp FreeBSD.conf FreeBSD.conf.bak
編輯配置文件
root@localhost:/etc/pkg # vi FreeBSD.conf
# 南京大學
FreeBSD: {
url: "http://mirrors.nju.edu.cn/freebsd-pkg/${ABI}/quarterly",
mirror_type: "srv",
signature_type: "fingerprints",
fingerprints: "/usr/share/keys/pkg",
enabled: yes
}
更新 pkg 数据库
root@localhost:/etc/pkg # pkg update
Updating FreeBSD repository catalogue...
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
pkg: No SRV record found for the repo 'FreeBSD'
Fetching meta.conf: 100% 178 B 0.2kB/s 00:01
Fetching data.pkg: 100% 7 MiB 7.3MB/s 00:01
Processing entries: 100%
FreeBSD repository update completed. 34404 packages processed.
All repositories are up to date.
查看當前使用的源
root@localhost:/etc/pkg # pkg -vv | grep url
url : "http://mirrors.nju.edu.cn/freebsd-pkg/FreeBSD:14:amd64/quarterly",
常用國內源