分类: 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 .
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.
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.
Uncomment the ``source
...
# 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"
...
You can print a list of overlays to choose from:
Add an overlay by using:
Just like portage, overlays need to be synchronised to keep up to date.
Individually:
Or all added overlays:
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 .
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.
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.
Update, depclean, then remove extra packages.
Run eix once more to check: (there should be no output)
Finally, remove the overlay:
Check that no dependencies are broken.
TODO: Need paludis info.
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.
Next, you need to make portage aware of the overlay through 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/"
...
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:
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:
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.
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).
Now you can install it like any other package.
If you're using paludis, don't forget to sync your local overlay first.