/etc/portage/repos.conf

From Gentoo Wiki
< /etc/portage(Redirected from Repos.conf)
Jump to: navigation, search
Other languages:
Deutsch • ‎English • ‎español • ‎hrvatski • ‎italiano • ‎polski • ‎português do Brasil • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어

/etc/portage/repos.conf specifies the location and settings for the repositories used by the current system. It can be a single file or directory of *.conf files. It refers to the Gentoo repository and perhaps ebuild repositories used on a system.

Format

  • File names can be arbitrary strings of characters with or without suffix, except for repos.conf/gentoo.conf expected by mirrorselect.
  • Comments begin with # (no inline comments).
  • Configuration of each repository is specified in a separate file or section starting with [repository_name]. It is recommended that [repository_name] is the same as the name given in the repo_name file.
  • Attributes are specified in attribute = value format.

Attributes supported in the default section

main-repo
Specifies main repository.
eclass-overrides
Makes all repositories inherit eclasses from the specified repositories. Setting this attribute is generally not recommended since resulting changes in eclass inheritance may trigger performance issues due to invalidation of metadata cache.
The egencache, emirrordist and repoman tools ignore this parameter by default as their operations are generally not site-specific (their operations are focused on the global, non-customized aspects of portage and the Gentoo repository). This behavior can be overruled by setting force = eclass-overrides.
force
Specifies names of attributes, which should be forcefully respected by egencache, emirrordist, and repoman. Valid values: aliases, eclass-overrides, and masters.

Attributes supported in sections of repositories

aliases
Specifies aliases of given repository. Setting this attribute is generally not recommended since resulting changes in eclass inheritance may trigger performance issues due to invalidation of metadata cache.
The egencache, emirrordist and repoman tools ignore this parameter by default as their operations are generally not site-specific (their operations are focused on the global, non-customized aspects of portage and the Gentoo repository). This behavior can be overruled by setting force = aliases.
auto-sync
This setting determines if the repo will be synced during emerge --sync or emaint sync --auto runs. This allows for repositories to be synced only when desired via emaint sync --repo foo. Valid values: yes, no, true, false. If unset, the repo will be treated as set yes, true.
eclass-overrides
Makes all repositories inherit eclasses from specified repositories. Setting this attribute is generally not recommended since resulting changes in eclass inheritance may trigger performance issues due to invalidation of metadata cache.
The egencache, emirrordist and repoman tools ignore this parameter by default as their operations are generally not site-specific (their operations are focused on the global, non-customized aspects of portage and the Gentoo repository). This behavior can be overruled by setting force = eclass-overrides.
force
Specifies names of attributes, which should be forcefully respected by egencache, emirrordist, and repoman. Valid values: aliases, eclass-overrides, and masters.
location
Specifies location of given repository.
masters
Specifies master repositories of given repository. Setting this attribute is generally not recommended since resulting changes in eclass inheritance may trigger performance issues due to invalidation of metadata cache.
The egencache, emirrordist and repoman tools ignore this parameter by default as their operations are generally not site-specific (their operations are focused on the global, non-customized aspects of portage and the Gentoo repository). This behavior can be overruled by setting force = masters.
priority
Specifies priority of given repository.
sync-cvs-repo
Specifies CVS repository.
clone-depth
Specifies clone depth to use for DVCS repositories. Defaults to 1 (only the newest commit). If set to 0, the depth is unlimited.
sync-depth
Specifies sync depth to use for DVCS repositories. If set to 0, the depth is unlimited. Defaults to 0.
sync-git-verify-commit-signature
Require the top commit in the repository to contain a good OpenPGP signature. Defaults to false.
sync-type
Specifies type of synchronization performed by emerge --sync. Valid non-empty values: cvs, git, rsync, svn, websync (<=portage-2.2.18), webrsync (>=portage-2.2.19). This attribute can be set to empty value to disable synchronization of given repository. Empty value is default.
sync-umask
Specifies umask used to synchronize the repository. Takes an octal permission mask, e.g. 022.
sync-uri
Specifies URI of repository used for synchronization performed by emerge --sync. This attribute can be set to empty value to disable synchronization of given repository. Empty value is default.
Syntax:
cvs: [cvs://]:access_method:[username@]hostname[:port]:/path
git: (git|git+ssh|http|https)://[username@]hostname[:port]/path
rsync: (rsync|ssh)://[username@]hostname[:port]/(module|path)
sync-user
Specifies the credentials used to perform the synchronization. If only user is provided, the primary group of the user will be used. If only group is provided, the current user will be preserved and only the group id will be changed. This key takes precedence over FEATURES=userpriv. If user or group id is provided, Portage no longer uses owner of the directory.
Syntax: [user][:group]

Usage

If it doesn't exist create it.

root #touch /etc/portage/repos.conf

(The Handbook however prefers using it as a directory.)

Add ebuild repositories using eselect repository, e.g. the brother-overlay ebuild repository:

root #eselect repository enable brother-overlay
Adding brother-overlay to /etc/portage/repos.conf ...
1 repositories enabled

Adding a custom repository is described in the Handbook.

Verify the setting using portageq

user $portageq repos_config /
[DEFAULT]
auto-sync = yes
main-repo = gentoo
strict-misc-digests = true
sync-allow-hardlinks = true
sync-rcu = false
 
[brother-overlay]
auto-sync = yes
location = /var/db/repos/brother-overlay
masters = gentoo
strict-misc-digests = true
sync-allow-hardlinks = true
sync-rcu = false
sync-type = git
sync-uri = https://github.com/gentoo-mirror/brother-overlay.git
 
[gentoo]
auto-sync = yes
location = /var/db/repos/gentoo
masters = 
priority = -1000
strict-misc-digests = true
sync-allow-hardlinks = true
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
sync-openpgp-key-refresh-retry-count = 40
sync-openpgp-key-refresh-retry-delay-exp-base = 2
sync-openpgp-key-refresh-retry-delay-max = 60
sync-openpgp-key-refresh-retry-delay-mult = 4
sync-openpgp-key-refresh-retry-overall-timeout = 1200
sync-openpgp-keyserver = hkps://keys.gentoo.org
sync-rcu = false
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
sync-rsync-verify-max-age = 24
sync-rsync-extra-opts = 
sync-rsync-verify-jobs = 1
sync-rsync-verify-metamanifest = yes
 
[localrepo]
auto-sync = no
location = /var/db/repos/localrepo
masters = gentoo
strict-misc-digests = true
sync-allow-hardlinks = true
sync-rcu = false

References in the output to Gentoo main repository come from the defaults in /usr/share/portage/config/repos.conf.

The file might then look like

FILE /etc/portage/repos.conf
[brother-overlay]
location = /var/db/repos/brother-overlay
sync-type = git
sync-uri = https://github.com/gentoo-mirror/brother-overlay.git
 
[localrepo]
location = /var/db/repos/localrepo
auto-sync = no

Eselect can also be used as an alternative to mirrorselect --rsync for setting the Gentoo rsync mirror.

root #eselect repository add gentoo rsync rsync://rsync.de.gentoo.org/gentoo-portage/
--2019-11-02 09:52:02--  https://qa-reports.gentoo.org/output/repos/repositories.xml
Resolving qa-reports.gentoo.org... 140.211.166.190, 2001:470:ea4a:1:230:48ff:fef8:9fdc
Connecting to qa-reports.gentoo.org|140.211.166.190|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 281674 (275K) [application/xml]
Saving to: '/root/.cache/eselect-repo/repositories.xml'

repositories.xml                                                                100%[======================================================================================================================================================================================================>] 275.07K   295KB/s    in 0.9s    

2019-11-02 09:52:04 (295 KB/s) - '/root/.cache/eselect-repo/repositories.xml' saved [281674/281674]

Adding gentoo to /etc/portage/repos.conf ...
Repository gentoo added

Manipulation of other attributes than name, sync-type or sync-uri seems not supported by eselect repository but could be done manually when needed.

For further options see man 5 repository.eselect.

Note
Other tools like layman and mirrorselect require and expect repos.conf to be a directory. Layman creates and manages it's own layman.conf file to register its installed ebuild repositories with Portage. mirrorselect looks for the repos.conf/gentoo.conf file in order to modify the sync-uri parameter for the Gentoo repository.

See also

External resources