Skip to content

Commit

Permalink
FreeBSD-pkg: port changes
Browse files Browse the repository at this point in the history
  • Loading branch information
taoky committed Feb 5, 2025
1 parent 90b6369 commit 8f2bf92
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions FreeBSD-pkg/usage.zh.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## 使用方法

### FreeBSD pkg

FreeBSD pkg 包管理器的官方源配置是 `/etc/pkg/FreeBSD.conf` ,请先检查该文件内容。注意其中的 `url` 参数配置了官方仓库的地址,我们需要把它替换为镜像站的地址。

该配置文件是 FreeBSD 基本系统的一部分,会随着 `freebsd-update` 更新,请不要直接修改,而是创建 `/usr/local/etc/pkg/repos/FreeBSD.conf` 覆盖配置,文件内容如下:
Expand All @@ -14,3 +16,22 @@ FreeBSD: {

注:使用 HTTPS 可以有效避免国内运营商的缓存劫持,但需要事先安装 `security/ca_root_nss` 软件包。


### Ports Collection & Poudriere

如果使用 [poudriere](https://github.com/freebsd/poudriere) 构建 `ports` 软件包,可以更改 `/usr/local/etc/poudriere.conf +374`,使用镜像站来获取二进制软件包。

<tmpl>
# Set to always attempt to fetch packages or dependencies before building.
# XXX: This is subject to change
# Default: off; requires -b <branch> for bulk or testport.
# PACKAGE_FETCH_BRANCH=latest
# The branch will be appended to the URL:
PACKAGE_FETCH_URL={{endpoint}}/\${ABI}
</tmpl>

同样,使用 HTTPS 需要 `security/ca_root_nss`

更改后,运行 `poudriere bulk` 时会报错:`No SRV record found for the repo`,此报错无害,不影响使用。

关于 `PACKAGE_FETCH_*` 的更多使用方法和配置可参考 `/usr/local/etc/poudriere.conf.sample`

0 comments on commit 8f2bf92

Please sign in to comment.