多数发行版都会自动更新所有添加的源,包括第三方源,如redhat系、debian系、arch linux等,而Gentoo添加了第三方源(overlay)之后,更新时,需要用layman -S命令来单独更新全部overlay。


  Title                     New portage plug-in sync system
  Author                    Brian Dolbec <>
  Posted                    2015-02-02
  Revision                  1

There is a new plug-in sync system in >=sys-apps/portage-2.2.16.
This system will allow third party modules to be easily installed.  Look
for a new layman plug-in sync module in layman's next release.  Next is
a brief look at the changes.  See the url [1] listed below for detailed
descriptions and usage.

Changes:  /etc/portage/repos.conf/*
    New setting for all repository types (needed):
        auto-sync = yes/no, true/false  # default if absent: yes/true

    New for git sync-type: (applies to clone only)
        sync-depth = n  where n = {0,1,2,3,...} (optional, default = 1)
            0 -- full history
            1 -- shallow clone, only current state (default)
            2,3,... number of history changes to download

    New sync-type modules:
        sync-type = svn  # sync a subversion repository
        sync-type = websync # Perform an emerge-webrsync operation
        sync-type = laymanator  # (if installed) runs a layman -s action

    New native portage postsync hooks
            Runs hooks once, only after all repos have been synced.
            Runs each script with three arguments:
                repo name, sync-uri, location
            Each script is run at the completion of every repo synced.

    Edit /etc/portage/repos.conf/*.conf files, add the auto-sync option
    to each repository definition.  Edit sync-type option to one of the
    supported types {rsync, git, cvs, svn, websync, laymanator}.
        sync-type = rsync
        auto-sync = yes

    For an existing /etc/portage/repos.conf/layman.conf file:
        1) change/add the sync-type
            sync-type = laymanator
        2) Ensure you have the correct layman version installed with
           it's laymanator module also installed.
    Alternate method:
        Please see the wiki page url [1] for detailed instructions.

Primary control of all sync operations has been moved from emerge to
emaint.  "emerge --sync" now just calls the emaint sync module with the
--auto option.  The --auto option performs a sync on only those
repositories with the auto-sync setting not set to 'no' or 'false'. If
it is absent, then it will default to yes and "emerge --sync" will sync
the repository.

NOTE: As a result of the default auto-sync = True/Yes setting, commands
    like "eix-sync", "esync -l", "emerge --sync && layman -S" will cause
    many repositories to be synced multiple times in a row.  Please edit
    your configs or scripts to adjust for the new operation.

    Due to the above default. For any repos that you EXPLICITLY do not
    want to be synced. You MUST set "auto-sync = no"

The 'emaint sync' module operates similar to layman.  It can sync
single or multiple repos.  See "emaint --help" or for more details and
examples see the wiki page listed below [1].

Additional help and project API documentation can be found at:


也就是从sys-apps/portage-2.2.16开始,添加了配置文件之后,用emerge –sync就可以直接更新overlay了。另外,layman也增加了一个use,sync-plugin-portage(Install the sys-apps/portage sync module),默认不开启。如果需要手动配置,可以采用以下方法:


mkdir /etc/portage/repos.conf
touch /etc/portage/repos.conf/layman.conf


location = /var/lib/layman/gentoo-zh
auto-sync = yes
sync-type = git
sync-uri =


priority = 50
location = /var/lib/layman/kde
auto-sync = No
layman-type = git


priority = 50
location = /var/lib/layman/kde
auto-sync = yes
sync-type = git
sync-uri =


以后,再用emerge –sync更新portage时,官方portage更新完成之后,会自动更新overlay,出现如下信息:

>>> Syncing repository 'gentoo-zh' into '/var/lib/layman/gentoo-zh'...
/usr/bin/git pull
remote: Counting objects: 15, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 15 (delta 4), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (15/15), done.
From git://
   da7bbf3..a4d1c13  master     -> origin/master
Updating da7bbf3..a4d1c13
 media-video/bilibili-player/Manifest                                                     | 2 +-
 media-video/bilibili-player/{bilibili-player-0.10.ebuild => bilibili-player-0.12.ebuild} | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
 rename media-video/bilibili-player/{bilibili-player-0.10.ebuild => bilibili-player-0.12.ebuild} (88%)
=== Sync completed for gentoo-zh
>>> Syncing repository 'kde' into '/var/lib/layman/kde'...
/usr/bin/git pull
Already up-to-date.
=== Sync completed for kde