/etc/portage/repos.conf/gentoo.conf

From Gentoo Wiki
< /etc‎ | portage‎ | repos.conf(Redirected from Gentoo.conf)
Jump to:navigation Jump to:search

This article provides detailed examples of different repos.conf sync-type configurations.

rsync

The example below shows the default set up of the main Gentoo repository. However, there is no need for having this file unless its content deviates from the file found at /usr/share/portage/config/repos.conf.

FILE /etc/portage/repos.conf/gentoo.confGentoo ebuild repository sync via rsync
[DEFAULT]
main-repo = gentoo

[gentoo]
location = /var/db/repos/gentoo
sync-type = rsync
sync-uri = rsync://rsync.gentoo.org/gentoo-portage
auto-sync = yes
sync-rsync-verify-jobs = 1
sync-rsync-verify-metamanifest = yes
sync-rsync-verify-max-age = 24
sync-openpgp-key-path = /usr/share/openpgp-keys/gentoo-release.asc
sync-openpgp-key-refresh-retry-count = 40
sync-openpgp-key-refresh-retry-overall-timeout = 1200
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

git

Important
Syncing via git requires git (dev-vcs/git) to be installed prior to the initial sync! Be sure it is installed before moving onward.

To configure the ::gentoo ebuild repository to sync using git as the sync protocol, one of the following configurations can be used.

Automatic configuration

First disable the gentoo repository:

root #eselect repository disable gentoo
Updating repos.conf ...
1 repositories disabled

Then enable the gentoo repository, using git as the sync type:

root #eselect repository enable gentoo git
--2023-03-24 09:32:49--  https://qa-reports.gentoo.org/output/repos/repositories.xml
Resolving qa-reports.gentoo.org... 151.101.129.91, 151.101.193.91, 151.101.1.91, ...
Connecting to qa-reports.gentoo.org|151.101.129.91|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 253938 (248K) [text/xml]
Saving to: '/root/.cache/eselect-repo/repositories.xml'

repositories.xml                100%[=======================================================>] 247.99K  --.-KB/s    in 0.06s   

2023-03-24 09:32:50 (4.20 MB/s) - '/root/.cache/eselect-repo/repositories.xml' saved [253938/253938]

Adding gentoo to /etc/portage/repos.conf ...
error: git: repository not in repositories.xml
1 repositories enabled

This will create the following file:

FILE /etc/portage/repos.conf/eselect-repo.conf
# created by eselect-repo

[gentoo]
location = /var/db/repos/gentoo
sync-type = git
sync-uri = https://github.com/gentoo/gentoo

Manual configuration

FILE /etc/portage/repos.conf/gentoo.confGentoo ebuild repository sync via git
[gentoo]
location = /var/db/repos/gentoo
sync-type = git
# Official "sync-friendly git mirror of repo/gentoo with caches and metadata"
# Currently not suggested for production use.
# sync-uri = https://anongit.gentoo.org/git/repo/sync/gentoo.git
# GitHub mirror which saves the Gentoo project bandwidth. *This* sync-friendly git mirror is preferred.
sync-uri = https://github.com/gentoo-mirror/gentoo.git
sync-git-verify-commit-signature = yes

# Default clone-depth setting does a shallow clone of the git repository.
# For a full clone and ability to view git log/changes, set clone-depth = 0.
# NOTE: A full clone of the gentoo repo is in excess of 6GB.
# clone-depth = 0
Note
Systems that are transitioning from the rsync sync method to git will refuse the initial sync. This is because git will want to sync into an empty directory. It is best practice to rename the rsync target directory and then perform the git checkout. For example:

root #mv /var/db/repos/gentoo /var/db/repos/gentoo.old-rsync
root #emaint sync -r gentoo
root #rm -r /var/db/repos/gentoo.old-rsync


This will also be necessary if you change the clone-depth configuration value from the default of 1.