5.3 Gitup 的用法

技巧

FreeBSD 14.0 已经删除了 portsnap,转而使用 Git,如本文所述可以使用 gitup 替代 portsnap。

gitup 是用于更新 Git 仓库的工具。

安装 gitup

  • 使用 pkg 安装:

# pkg install gitup 
  • 或者使用 Ports 安装:

# cd /usr/ports/net/gitup/
# make install clean

使用 gitup

# gitup ports 	# 获取 latest 分支的 Ports
# gitup release # 获取 release 版本的源代码

境内 Git 镜像站

将 gitup 的示例配置文件复制为正式配置文件:

# cp /usr/local/etc/gitup.conf.sample /usr/local/etc/gitup.conf

编辑 /usr/local/etc/gitup.conf,修改内容如下(有 ①②③ 共计三处需要修改):

拉取 ports:

故障排除与未竟事宜

速度太慢(若不使用镜像站)

需要设置 HTTP 代理:gitup 不使用系统代理,而是由其配置文件 /usr/local/etc/gitup.conf 单独决定代理设置。

示例(先删去前面的 # 再修改):

详细调试输出

以详细模式更新 ports 树到最新版本:

报错 build_repair_command: There are too many files to repair -- please re-clone the repository: Argument list too long

清空 /usr/ports 目录中的所有现有内容,准备重新同步 Ports:

使用 gitup 同步并拉取最新的 FreeBSD Ports 树:

清空目录后重新拉取即可,可以忽略 rm: /usr/ports/: Device busy 提示。

参考链接

最后更新于

这有帮助吗?