Gentoo ebuild 仓库包含 Portage 用于解析和构建软件包的 ebuild 与元数据。
相应镜像只提供该仓库的 Git 同步服务。
rsync 同步配置见 Gentoo Portage 帮助。
Distfiles(软件源代码文件)与二进制包镜像的配置见 Gentoo 帮助。
安装 eselect-repository:
emerge --ask app-eselect/eselect-repository删除现有的 Gentoo ebuild 仓库配置和本地副本,再使用相应镜像添加 Git 仓库:
eselect repository remove -f gentoo
eselect repository add gentoo git https://mirrors.tuna.tsinghua.edu.cn/git/gentoo-portage.git同步 Gentoo ebuild 仓库:
emaint sync -r gentoo不同镜像的同步进度可能不同;更换 Git 镜像时,建议使用上述方法删除并重新添加仓库。
系统默认配置文件位于 /etc/portage/repos.conf/gentoo.conf,只需修改 sync-uri 与 sync-type。
通过 eselect-repository 生成的配置位于 /etc/portage/repos.conf/eselect-repo.conf。
完整配置示例:
[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://mirrors.tuna.tsinghua.edu.cn/git/gentoo-portage.git首次从 rsync 切换到 Git 或更换镜像时,删除现有的本地仓库并重新同步:
rm -rf /var/db/repos/gentoo
emaint sync -r gentoo配置原理和排障方法见 Portage with Git。