eselect/repository/zh-cn
Warning: Display title "eselect/repository/zh-cn" overrides earlier display title "Eselect/Repository".
eselect-repository 是 一个 eselect 模块,用来针对第三方仓库来操控 /etc/portage/repos.conf (又称为 overlay)。
This utility supersedes app-portage/layman for listing, configuring, and handling synchronization of alternate repositories except for version control systems which the package manager does not natively sync (eg. mercurial, bazaar, and g-sorcery in Portage).
安装
Emerge
root #
emerge --ask app-eselect/eselect-repository
配置
初始设置
REPOS_CONF
目录在下面的文件中配置。它必须在模块正常运行之前就存在。
为了确保它存在,运行(以默认为例):
root #
mkdir -p /etc/portage/repos.conf
文件
/etc/eselect/repository.conf
# configuration for eselect-repo # (sourced by bash, so keep the values bash-compatible) # The following variables can be used below to reference paths # configured at build time: # CACHEDIR -- system cache directory (e.g. /var/cache) # SYSCONFDIR -- system configuration directory (e.g. /etc) # SHAREDSTATEDIR -- system shared state directory (e.g. /var) # Location of the repository configuration file or directory. If it is # a directory, Portage rules for subfiles are used. REPOS_CONF=${SYSCONFDIR}/portage/repos.conf # File to use for newly added repositories when REPOS_CONF is # a directory. REPOS_CONF_SUBFILE=${REPOS_CONF}/eselect-repo.conf # Top directory to keep newly added repositores in. New repositories # will be added with subdirectories following repository names. REPOS_BASE=${SHAREDSTATEDIR}/db/repos # Location of the remote repository list. The default is to use # the gentoo-mirror list that contains pregenerated metadata cache. REMOTE_LIST_URI=https://qa-reports.gentoo.org/output/repos/repositories.xml # Alternative: original Gentoo list. #REMOTE_LIST_URI=https://api.gentoo.org/overlays/repositories.xml # Directory to store repositories.xml cache. The file will always # be called "repositories.xml" due to technical limitations of wget. REMOTE_LIST_CACHEDIR=~/.cache/eselect-repo # Interval (in seconds) to check the remote repository list for changes. # The default is 2 hours. REMOTE_LIST_REFRESH=$(( 2 * 3600 ))
使用
Gentoo allows users and developers to register their repositories for public consumption. eselect repository will fetch and read the known list.
列出已经注册的仓库
root #
eselect repository list
Available repositories: [1] foo [2] bar [3] baz [4] cross # [5] good * [6] my_overlay @
- 已安装,已启动的仓库后缀为 * 字符。
- 后缀为 # 的仓库,需要更新它们的同步信息(从禁用或启用的仓库)或者由用户定制。
- 后缀为 @ 的仓库,未在官方公布的名单。
- 添加
-i
选项参数只列出已安装的仓库。
添加已经注册的仓库
语法: enable (<name>|<index>)...
root #
eselect repository enable foo bar baz
添加未注册的仓库
语法: add <name> <sync-type> <sync-uri>
root #
eselect repository add test git https://github.com/test/test.git
禁用仓库但是不移除内容
语法: disable [-f] (<name>|<index>)...
root #
eselect repository disable foo bar
未注册仓库需要使用 -f
选项,并且不同步它们的属性。
禁用仓库并且移除内容
Syntax: remove [-f] (<name>|<index>)...
root #
eselect repository remove bar baz
未注册仓库需要使用 -f
选项,并且不同步它们的属性。
另请参阅
- Eselect — a tool for administration and configuration on Gentoo systems.