From Gentoo Wiki
Jump to:navigation Jump to:search
This page contains changes which are not marked for translation.
Other languages:
English • ‎español • ‎русский • ‎தமிழ் • ‎日本語

eselect-repository is an eselect module for manipulating /etc/portage/repos.conf entries.

This utility supersedes layman for listing, configuring, and handling synchronization of alternate repositories except for version control systems which the package manager does not natively sync (eg. darcs and g-sorcery in Portage).

eselect-repository is written and maintained by Gentoo's Michał Górny (mgorny).



root #emerge --ask app-eselect/eselect-repository


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.

Gentoo Handbook prefers to have it as a directory:

root #mkdir -p /etc/portage/repos.conf


FILE /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.

# 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.
# Top directory to keep newly added repositores in. New repositories
# will be added with subdirectories following repository names.
# Location of the remote repository list. The default is to use
# the gentoo-mirror list that contains pregenerated metadata cache.
# Alternative: original Gentoo list.
# Directory to store repositories.xml cache. The file will always
# be called "repositories.xml" due to technical limitations of wget.
# 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.

Listing registered repositories

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.
  • Adding the -i optional parameter will only list installed repositories

Add registered repositories

Syntax: enable (<name>|<index>)...

root #eselect repository enable foo bar baz

Add unregistered repositories

Syntax: add <name> <sync-type> <sync-uri>

root #eselect repository add test git

Disable repositories without removing contents

Syntax: disable [-f] (<name>|<index>)...

root #eselect repository disable foo bar

The -f option is required for unregistered repositories and those without sync attributes

Disable repositories and remove contents

Syntax: remove [-f] (<name>|<index>)...

root #eselect repository remove bar baz

The -f option is required for unregistered repositories and those without sync attributes

Create a new local repository

The create subcommand will make an ebuild repository skeleton:

Syntax: create <name> [<path>]

root #eselect repository create localrepo

Sync added repository

Repositories can be synced using Portage's emaint:

root #emaint sync -r foo

See also

  • Eselect — a tool for administration and configuration on Gentoo systems.