Chinaunix首页 | 论坛 | 博客
  • 博客访问: 637303
  • 博文数量: 154
  • 博客积分: 8323
  • 博客等级: 中将
  • 技术积分: 2060
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-13 02:17
文章分类

全部博文(154)

文章存档

2011年(2)

2010年(117)

2009年(5)

2008年(30)

分类: LINUX

2010-09-03 10:26:57

Overlays are used in gentoo to install and manage packages that are not available in the main portage tree or for writing and testing new ebuilds.

Overlays can greatly expand the range of packages available for you to install, but are generally contain less-well-tested ebuilds than the main portage tree. Depending on the overlay, there may be no, or very limited support offered for packages from overlays, or systems that use many packages from overlays. In general, don't post bugs for overlay ebuilds.

Be discriminating when adding overlays to your system - the more that you add, the more likely it becomes that they will clutter up your package tree and introduce bugs that the Gentoo developers cannot replicate or fix.

To install an ebuild that you found somewhere, read about making a , then how to .


Using Overlays with Portage - Layman

Layman is a tool designed to help automate management of your local repository of overlays you want included into your Gentoo system. It downloads a list of existing overlays from the Internet, and it can only handle overlays from this list. Most of its documentation can be found on its website or man page.

Start with installing Layman.

emerge layman

Many overlays are only available using version control software. If the required vcs for an overlay is not installed, then layman will not list it.

emerge dev-vcs/subversion dev-vcs/git dev-vcs/mercurial

make.conf

Uncomment the ``source `` line below as appropriate for your version of layman.

File: /etc/make.conf
...

# If you have >=app-portage/layman-1.3.0
# source "/var/lib/layman/make.conf"

# If you have >=app-portage/layman-1.2.0
# source "/usr/local/portage/layman/make.conf"

# If you have # source "/usr/portage/local/layman/make.conf"

...

Listing and Adding Overlays

You can print a list of overlays to choose from:

layman -L

Add an overlay by using:

layman --add

Synchronising

Just like portage, overlays need to be synchronised to keep up to date.

Individually:

layman --sync

Or all added overlays:

layman -S

Using Overlays with Paludis

has full native support for multiple repositories. Overlays are merely a special case where a repository has another 'master' repository.

In its default location, /etc/paludis/repositories contains configuration files for overlays. You can add an overlay by manually writing new files, or by using playman -- a ruby script included with Paludis when built with ruby. playman can only create repository information files, not modify or delete them. You'll have to do this manually.

Please note that if you're using Paludis, you might not need a local overlay, because paludis comes with a neat tool called .

Removing Overlays

If you want to remove an overlay from your system, you should check what you have installed from it first. To do this, we will use the eix tool.

emerge eix && eix-sync
eix -I --in-overlay

You will now have some output displaying all the packages that you have installed, where *one version or more is available in the overlay*. This is not the same as "everything listed is something that you have installed from an overlay". You may have packages installed, where some versions are from the portage tree and others from the overlay. Do not remove these, you just have to make sure that you have the versions from portage, not from the overlay.

Check the output, and remove the packages that you don't want/need any more.

Warning: Any packages that you keep the overlay versions of will be unmaintained by portage after you remove the overlay. Keeping them is unsupported.

Update, depclean, then remove extra packages.

emerge -uDvN world
emerge --depclean world
emerge -Cav

Run eix once more to check: (there should be no output)

eix-sync && eix -I --in-overlay

Removing Overlays with Layman (portage)

Finally, remove the overlay:

layman -d

Check that no dependencies are broken.

emerge -uDavN world

Removing Overlays with Paludis

TODO: Need paludis info.

Local Overlays

Creating a Local Overlay with Portage

To create a local overlay, the first step is to choose a directory in which it will live. A common place is /usr/local/portage/. You also need to add a profiles directory and specify a repository name.

# mkdir -p /usr/local/portage/profiles/
# echo "my_local_overlay" > /usr/local/portage/profiles/repo_name


Next, you need to make portage aware of the overlay through make.conf

File: /etc/make.conf
...
source /usr/local/portage/layman/make.conf

# If you have layman installed, this line must be below the layman make.conf line
PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/"
...

Creating a Local Overlay with Paludis

Paludis users need to create a new file in /etc/paludis/repositories/, for example one called /etc/paludis/repositories/local_overlay.conf. In it, place these contents:

File: /etc/paludis/repositories/
location=${ROOT}/usr/local/portage/
sync =
master_repository = gentoo
format = ebuild
names_cache = ${location}/.cache/names
write_cache = /var/cache/paludis/metadata

And sync this repository:

# paludis -s x-local_overlay

Adding packages to a Local Overlay

Now you can add ebuilds to /usr/local/portage/ in the same way the portage tree, or any ebuild-style overlay is populated.

For example, if you want to emerge www-foo/foofox-3.5 which you found in the bug tracker, create a directory for it, move the ebuild into the directory.

# mkdir -p /usr/local/portage/www-foo/foofox/
# mv foofox-3.5.ebuild /usr/local/portage/www-foo/foofox/
# cd /usr/local/portage/www-foo/foofox/

Next, you need to create a digest for portage to use to check the files that it downloads (Read up on writing ebuilds to find out what digests are).

# ebuild foofox-3.5.ebuild manifest

Now you can install it like any other package.

# emerge www-foo/foofox

If you're using paludis, don't forget to sync your local overlay first.

See Also

External Links

  • Search engine for packages in the main tree, plus overlays.
  • Search engine for packages in overlays only.
阅读(3067) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~