标签存档: emerge

Gentoo的portage已支持直接更新第三方源(overlay)

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

现在,最新的portage管理器也终于支持用emerge命令来更新overlay了!

2015-02-04-portage-sync-changes
  Title                     New portage plug-in sync system
  Author                    Brian Dolbec <dolsen@gentoo.org>
  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
        /etc/portage/postsync.d/*
            Runs hooks once, only after all repos have been synced.
        /etc/portage/repo.postsync.d/*
            Runs each script with three arguments:
                repo name, sync-uri, location
            Each script is run at the completion of every repo synced.

Migration:
    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}.
        [some-repo]
        ...
        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.

WARNING:
    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:

[1] https://wiki.gentoo.org/wiki/Project:Portage/Sync

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

1、首先,需要创建一个配置文件。安装portage和layman时没有自动创建文件和目录,只好手动创建了。

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

2、手动添加配置信息,例如gentoo-zh:

[gentoo-zh]
location = /var/lib/layman/gentoo-zh
auto-sync = yes
sync-type = git
sync-uri = https://github.com/microcai/gentoo-zh.git

注:有了配置文件之后,新安装的overlay也会自动添加配置文件,但需要修改,否则更新时出错。这是默认添加的配置:

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

有三个地方需要修改:auto-sync的No修改为yes;layman-type改为sync-type;按前面配置方式添加sync-uri项。改成下面内容:

[kde]
priority = 50
location = /var/lib/layman/kde
auto-sync = yes
sync-type = git
sync-uri = https://github.com/gentoo/kde.git

配置完成。

以后,再用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://github.com/microcai/gentoo-zh
   da7bbf3..a4d1c13  master     -> origin/master
Updating da7bbf3..a4d1c13
Fast-forward
 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

用aria2加速emerge下载

linux下强大的下载工具aria2,用它可以加速emerge时下载软件包。方法:

在/etc/make.conf中添加如下代码:

FETCHCOMMAND="/usr/bin/aria2c -d ${DISTDIR} ${URI}"
RESUMECOMMAND="/usr/bin/aria2c -d ${DISTDIR} ${URI}"

用layman安装gentoo-zh中的goagent

goagent是什么不解释,自己百度一下。

原来一直用的是googlecode上的deb包,没写ebuild(主要是不会写),解压出来用的。今天修复了layman之后,更新了一下,发现gentoo-zh中有了goagent这个包。于是把原来手动安装的卸载掉,emerge上这个包。

软件相关信息及使用说明如下:

 * Messages for package net-proxy/goagent-1.8.11:

 * 
 * config file: /etc/goagent
 * init script: /etc/init.d/goagent
 * 
 * Usage:
 * vim /etc/goagent
 * vim /opt/goagent/server/golang/fetch/fetch.go
 * vim /opt/goagent/server/golang/app.yaml
 * cd /opt/goagent/server
 * upload={golang|python|php} python2.7 uploader.zip
 * /etc/init.d/goagent start|stop|restart
 * 
 * if you get some error in the uploading,
 * please upload through other proxy.
 * e.g. 'export https_proxy=127.0.0.1:8087',
 * and then upload again.
 *

emerge强迫症

现在每天都至少运行好几次:

emerge --sync && emerge --update --deep --newuse --with-bdeps=y @world && emerge --depclean && revdep-rebuild

和原来在ubuntu下一样,在u下是运行:

sudo apt-get update && sudo apt-get upgrade

gentoo,可怕的编译

这几天一直在gentoo下emerge,非常考验人的耐性和解决问题的能力。

一是编译过程异常的长,有时一个软件编译一两个小时;

二是会出现各种各样的问题,等着你去解决,网上搜来搜去的,当然也有解决问题后的快乐;

三是编译需要占用很大硬盘空间,现在10G的分区经常出现硬盘空间不足的提示。