# pkgsrc 软件仓库

> 可调整选项：
> - 镜像地址：`https://mirrors.cernet.edu.cn/pkgsrc`
> - sudo：`开启`


> 本站收录所有共享帮助文档；文档存在不代表浙江大学镜像站当前提供该镜像。请查阅 https://mirrors.zju.edu.cn/mirrorz.json 确认当前目录与状态。
> 下列命令使用上述选项，请根据实际系统版本选择；未填写的文本选项需要在原文页面补充。

**注：该镜像是 pkgsrc 二进制包和 distfile 的镜像。本镜像站同时提供 pkgsrc 源码的镜像，请参考 [pkgsrc.git 镜像使用帮助](<https://mirrors.zju.edu.cn/docs/pkgsrc.git/>)。**

### 二进制包使用

输入

```bash
echo https://mirrors.cernet.edu.cn/pkgsrc/packages/NetBSD/<ARCH>/<VERSION>/All > $PKGDIR/etc/pkgin/repositories.conf
```

其中 `<ARCH>` 和 `<VERSION>` 可选范围可参看以下链接

```
https://mirrors.cernet.edu.cn/pkgsrc/packages/NetBSD/
```

注意该镜像不包括 joyent 内容，即`MacOS`，`SmartOS`，`Linux`中二进制包。

### distfile 使用

如果想使用该镜像的 distfile 强制替换全部 distfile 的下载路径，编辑`$PKGSRCDIR/mk/defaults/mk.conf`，并添加

```
MASTER_SITE_BACKUP= https://mirrors.cernet.edu.cn/pkgsrc/distfiles/
MASTER_SITE_OVERRIDE= https://mirrors.cernet.edu.cn/pkgsrc/distfiles/
MASTER_SORT= .edu.cn .cn
```

若只是部分替代，可参考

```
MASTER_SITE_CYGWIN= https://mirror/cygwin/
MASTER_SITE_GNU= https://mirror/gnu/
MASTER_SITE_PERL_CPAN= https://mirror/CPAN/modules/by-module/
MASTER_SITE_TEX_CTAN= https://mirror/CTAN/
MASTER_SITE_BACKUP= https://mirrors.cernet.edu.cn/pkgsrc/distfiles/
MASTER_SORT= .edu.cn .cn
```

其中非 pkgsrc 的变量可参考[ Cygwin 帮助](<https://mirrors.zju.edu.cn/docs/cygwin/>)，[ GNU 帮助](<https://mirrors.zju.edu.cn/docs/gnu/>)，[ CPAN 帮助](<https://mirrors.zju.edu.cn/docs/CPAN/>)，[CTAN 帮助](<https://mirrors.zju.edu.cn/docs/CTAN/>)。

---

许可：[CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/)
文档索引：https://mirrors.zju.edu.cn/llms.txt
如仅限浙大校内网络访问，可将 mirrors.cernet.edu.cn 替换为 mirrors.zju.edu.cn。
