Eselect/Repository
eselect-repository is an eselect module for configuring ebuild repositories for Portage. Ebuild repository configuration files are stored in /etc/portage/repos.conf.
For further options see man repository.eselect.
This utility supersedes layman for listing, configuring, and handling synchronization of alternate repositories. There are still some exceptions for which layman can supplement eselect-repository, when using version control systems that Portage does not natively sync (e.g. darcs and g-sorcery in Portage).
eselect-repository is written and maintained by Gentoo's Michał Górny (mgorny) .
Installation
Emerge
root #
emerge --ask app-eselect/eselect-repository
Configuration
Initial setup
The repos.conf file or directory as configured by the REPOS_CONF variable in /etc/eselect/repository.conf, must exist before the module will function properly. The Gentoo Handbook prefers to have it as a directory, and some tools will not work otherwise:
root #
mkdir -p /etc/portage/repos.conf
Files
/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. You can use "${repository}" to refer to the name
# of repository being added.
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 ))
Usage
Repositories can be synced after being configured, using Portage's emaint:
root #
emaint sync -r foo
repos.gentoo.org
Gentoo allows users and developers to register repositories on repos.gentoo.org, for public consumption. eselect repository will fetch and read the known list.
Listing ebuild repositories registered with repos.gentoo.org
eselect repository can print all repositories listed on repos.gentoo.org:
user $
eselect repository list
Available repositories: [1] foo [2] bar [3] baz [4] cross # [5] good * [6] my_overlay @
- Installed, enabled repositories are suffixed with a * character.
- Repositories suffixed with #, need their sync information updated (via disable/enable) or were customized by the user.
- Repositories suffixed with @ are not listed by name in the official, published list.
Use the -i
option to show currently configured repositories only:
user $
eselect repository list -i
Add ebuild repositories from repos.gentoo.org
Syntax: enable (<name>|<index>)...
root #
eselect repository enable foo bar baz
Add repositories
Todo:
Todo:
- list and explain available sync types.
Syntax: add <name> <sync-type> <sync-uri>
root #
eselect repository add test git https://github.com/test/test.git
When an ebuild repository is added for the first time, it must be synchronized before use.
While the Gentoo ebuild repository is either written or reviewed by Gentoo developers, and the GURU repository has some developer oversight, that is not always the case for other ebuild repositories. It is possible that some ebuilds repositories might contain vulnerable, badly broken or, theoretically, even malicious software.
Disable repositories without removing contents
Syntax: disable [-f] (<name>|<index>)...
root #
eselect repository disable foo bar
The -f
option is required for repositories not registered with repos.gentoo.org, and those without sync attributes. Use with care.
Disable repositories and remove contents
Syntax: remove [-f] (<name>|<index>)...
root #
eselect repository remove bar baz
The -f
option is required for repositories not registered with repos.gentoo.org, and those without sync attributes. Use with care.
Create a new ebuild repository
The create subcommand will create an ebuild repository skeleton, and configure it with Portage:
Syntax: create <name> [<path>]
root #
eselect repository create <ebuild_repository_name>
Adding <ebuild_repository_name> to /etc/portage/repos.conf ... Repository <ebuild_repository_name> created and added
See also
- Eselect — a tool for administration and configuration on Gentoo systems.
- Useful Portage tools — provides a list of Gentoo-specific system management tools, notably for Portage, available in the ebuild repository.
- Project:Portage/Sync