-
Notifications
You must be signed in to change notification settings - Fork 163
Clarify FreeBSD 15 pkg repository rename to FreeBSD-ports #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2fff2ac
312a257
d2d9961
f8eb696
64bba1e
04c0865
b55f057
0933523
38d26fe
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,32 +12,103 @@ FreeBSD 预编译软件包的**动态缓存** | |
|
|
||
| 所有受官方支持版本的 amd64 和 aarch64 架构,详细参见 <https://pkg.freebsd.org/>。 | ||
|
|
||
| 仓库包括季度分支 quarterly 和滚动更新的 latest 仓库。 | ||
| 仓库提供两种软件包分支:季度更新的 quarterly 与滚动更新的 latest。两者仅影响第三方软件包(ports)。 | ||
|
|
||
| !!! tip | ||
|
|
||
| 并非所有版本和架构都同时拥有 quarterly 或 latest 仓库,如 CURRENT 仅有 latest。 | ||
| 软件包分支与 FreeBSD 基本系统版本无关。不同 RELEASE / STABLE / CURRENT 均可使用 quarterly 或 latest。 | ||
|
|
||
| ## 使用方法 | ||
| 但并非所有版本和架构都同时提供两种分支,例如 CURRENT 通常仅提供 latest。 | ||
|
|
||
| !!! warning | ||
| 从 FreeBSD 15.0 起,若在安装系统时或事后手动启用了 pkgbase,则基本系统组件也会以软件包形式由 pkg 管理。此时,`/usr/local/etc/pkg/repos` 目录下将会默认带有一个配置文件。 | ||
|
|
||
| 在操作前请做好相应备份。 | ||
| 在这种情况下,请先检查 `/usr/local/etc/pkg/repos` 是否为空,并确认 `/usr/local/etc/pkg` 下不存在旧配置文件;如存在请先备份。 | ||
|
|
||
| 为了避免可能出现的向后兼容问题,基本系统中未预置真实的 pkg(8) 工具,需要在线安装。参见 [man pkg(7)](https://man.freebsd.org/cgi/man.cgi?query=pkg)。安装方法为直接输入命令 `pkg` 根据提示进行确认安装。为了避免因网络问题造成安装失败,建议先按以下方法换源后再安装 pkg。 | ||
| 请勿将文件命名为其他 `.conf` 以外的名称,避免覆盖现有设置。 | ||
|
|
||
| 完成确认后,再写入对应的镜像配置到 `/usr/local/etc/pkg/repos/ustc.conf`。 | ||
|
|
||
| FreeBSD pkg 包管理器的官方源的配置路径为 `/etc/pkg/FreeBSD.conf`。不建议直接修改此文件:该配置文件是 FreeBSD 基本系统的一部分,会随着基本系统的更新而变化。 | ||
| ## 使用方法 | ||
|
|
||
| 应创建路径及文件 `/usr/local/etc/pkg/repos/USTC.conf` 来覆盖配置,文件内容如下: | ||
| !!! warning | ||
|
|
||
| ```yaml | ||
| ustc: { | ||
| url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly" | ||
| } | ||
| FreeBSD: { enabled: no } | ||
| ``` | ||
| 在操作前请做好相应备份。 | ||
|
|
||
| 若要使用滚动更新的 latest 仓库,将 `url` 这行配置末尾的 `quarterly` 换成 `latest` 即可。 | ||
| 此处只列出了 `quaterly` 季度分支,若有其他需求,请自行修改。 | ||
|
|
||
| 为了避免可能出现的向后兼容问题,基本系统中未预置真实的 pkg(8) 工具,需要在线安装。参见 [man pkg(7)](https://man.freebsd.org/cgi/man.cgi?query=pkg)。安装方法为直接输入命令 `pkg` 根据提示进行确认安装。为了避免因网络问题造成安装失败,建议先按以下方法换源后再安装 pkg。 | ||
|
|
||
| FreeBSD pkg 包管理器的官方源的配置路径为 `/etc/pkg/FreeBSD.conf`。不建议直接修改此文件:该配置文件是 FreeBSD 基本系统的一部分,会随着基本系统的更新而变化。 | ||
| 应新创建路径及文件 `/usr/local/etc/pkg/repos/USTC.conf` 来覆盖配置,文件内容如下: | ||
|
|
||
| === "FreeBSD 15.X-RELEASE" | ||
|
|
||
| ```yaml | ||
| ustc-ports: { | ||
| url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly", | ||
| mirror_type: "none", | ||
| signature_type: "fingerprints", | ||
| fingerprints: "/usr/share/keys/pkg", | ||
| enabled: yes | ||
| } | ||
|
|
||
| ustc-ports-kmods: { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 看起来
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
不是。kmods 是将树外常用的内核独立出来放在一个路径中,方便在安装时 bsdinstall 和安装后 fwget 调用安装。因为统一在 ports 内会出现 ABI 偶然的不兼容。 pkgbase 是 src 构建出来的,具体方法是 cd /usr/src
make -s -j$(sysctl -n hw.ncpu) TARGET_ARCH=amd64 buildworld
make -s -j$(sysctl -n hw.ncpu) TARGET_ARCH=amd64 buildkernel
make -s -j$(sysctl -n hw.ncpu) TARGET_ARCH=amd64 packages
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK,所以 kmods 是总是启用的,然后 pkgbase 是默认不打开,需要用户手工开启? https://www.freebsd.org/releases/15.0R/announce/:
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
如果用户在安装中使用了 pkgbase 这种安装方式,则会在 15.0 默认主配置文件在 https://github.com/freebsd/freebsd-src/blob/releng/15.0/usr.sbin/pkg/FreeBSD.conf.quarterly-release,该文件中禁用了 pkgbase,启用了 kmod 和一般的 pkg 包。 若使用 pkgbase,则显式覆盖并启用 pkgbase,源代码在 https://github.com/freebsd/freebsd-src/blob/main/usr.sbin%2Fbsdinstall%2Fscripts%2Fpkgbase.in 第 359-362 行,15.0 也被回溯了。 |
||
| url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/kmods_quarterly_${VERSION_MINOR}", | ||
| mirror_type: "none", | ||
| signature_type: "fingerprints", | ||
| fingerprints: "/usr/share/keys/pkg", | ||
| enabled: yes | ||
| } | ||
|
|
||
| FreeBSD-ports: { | ||
| enabled: no | ||
| } | ||
|
|
||
| FreeBSD-ports-kmods: { | ||
| enabled: no | ||
| } | ||
|
|
||
| # 仅当启用 pkgbase 时才添加以下内容 | ||
| #ustc-base: { | ||
| # url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/base_release_${VERSION_MINOR}", | ||
| # mirror_type: "none", | ||
| # signature_type: "fingerprints", | ||
| # fingerprints: "/usr/share/keys/pkgbase-${VERSION_MAJOR}", | ||
| # enabled: yes | ||
| #} | ||
|
|
||
| #FreeBSD-base: { | ||
| # enabled: no | ||
| #} | ||
| ``` | ||
|
|
||
| === "FreeBSD 14.X-RELEASE" | ||
|
|
||
| ```yaml | ||
| ustc: { | ||
| url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly", | ||
| mirror_type: "none", | ||
| signature_type: "fingerprints", | ||
| fingerprints: "/usr/share/keys/pkg", | ||
| enabled: yes | ||
| } | ||
|
|
||
| ustc-kmods: { | ||
| url: "https://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/kmods_quarterly_${VERSION_MINOR}", | ||
| mirror_type: "none", | ||
| signature_type: "fingerprints", | ||
| fingerprints: "/usr/share/keys/pkg", | ||
| enabled: yes | ||
| } | ||
|
|
||
| FreeBSD: { | ||
| enabled: no | ||
| } | ||
|
|
||
| FreeBSD-kmods: { | ||
| enabled: no | ||
| } | ||
| ``` | ||
|
|
||
| 修改配置后,运行 `pkg update -f` 更新索引。 | ||
|
|
||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.