FAQ: How do I ...?
- Use
ccache
- Use
distcc
- Specify default options
- Remove unneeded packages
- Unmask a Package
- Sync from CVS
- Sync from a Gentoo tree snapshot
- Recover VDB
- Remove Portage from my Gentoo installation
Use ccache
To enable ccache
, simply set the relevant variables in your
configuration bashrc
:
PATH="/usr/lib/ccache/bin/:${PATH}" CCACHE_DIR="/var/tmp/ccache" SANDBOX_WRITE="${SANDBOX_WRITE}:${CCACHE_DIR}"
You'll need to make sure that your ccache directory has appropriate permissions. Paludis
will sometimes use the paludisbuild
user when compiling.
You can set the maxium size of the cache by running (for example)
CCACHE_DIR="/var/tmp/ccache" ccache -M 2G
once as root.
Use distcc
To enable distcc
, simply set the relevant variables in your
configuration bashrc
:
DISTCC_DIR="/var/tmp/paludis/.distcc" DISTCC_HOSTS="localhost another_host" PATH="/usr/lib/distcc/bin:${PATH}" SANDBOX_WRITE="${SANDBOX_WRITE}:${DISTCC_DIR}"
Specify default options
Often users want to specify certain options by default. Common choices include:
--log-level warning
(you should not usesilent
in this way -- warnings are warnings because you need to read them)--show-reasons summary
--resume-command-template $HOME/.paludis-resume-XXXXXX
--dl-reinstall-scm weekly
You can either use a shell alias, or export
PALUDIS_OPTIONS="--options"
(in your environment, not in the
configuration bashrc
).
Remove unneeded packages
Paludis has three ways of removing unused packages. You should always
use --pretend
and check the output before proceeding:
--uninstall-unused
-
For the purposes of
--uninstall-unused
, an installed package is used if any of these conditions are true:- It is matched by any dependency specification in any repository's
system
orworld
set. - It is depended upon by another used package.
This action will therefore flag any packages that are no longer in use, for example because they were only pulled in by a package that is no longer installed, or because they were required by an old version of a package but no longer are.
- It is matched by any dependency specification in any repository's
--uninstall --with-unused-dependencies
-
This action will uninstall a package, along with any of its dependencies that will no longer be used once the target package is removed.
This action is recursive, so if
foo
depends uponbar
andbar
depends uponbaz
, and if neitherbar
norbaz
are otherwise required, uninstallingfoo
will also uninstallbar
thenbaz
. --uninstall --with-dependencies
-
This action will uninstall a package, along with any other package that requires this package as a dependency. Again, this action is recursive.
Some important notes:
- These actions rely upon a package's dependencies being correctly specified. They do not attempt to figure out whether a package has unlisted dependencies using devious trickery.
- These actions rely upon a package correctly using
USE
flags. If a package was built with, say,-foo
whilstlibfoo
was installed, Paludis will not consider the package to requirelibfoo
. Unfortunately, some people don't know how to useautoconf
correctly, so this assumption is currently not entirely safe in all cases. - Currently a package's build dependencies, as well as its runtime and post dependencies, are used when determining needed packages. Experimentation has shown that doing otherwise will lead to an awful lot of breakage -- in the future, if ebuild authors start being more careful, this behaviour may become controllable.
- For the case of any-of (
|| ( foo bar )
) dependencies, Paludis currently does the safe thing and assumes that all available options, if installed, are needed. This cannot be changed safely until ebuild authors stop abusing|| ( )
-- this construct should only be used where the dependency can be switched at runtime, but unfortunately it is often used to mean "compile against one of these".
Unmask a Package
First, you need to determine how a package is masked. The easiest way to do
this is to use paludis --query
. Then, if you're sure you really
want to unmask a package, and bearing in mind that doing so might break your
system, you need to override the mask. How to do this depends upon the mask
reasons:
- keyword
- You need to add an entry to your
keywords.conf
accepting one of the ebuild's keywords. The special-*
keyword cannot be accepted this way; if an ebuild only has this in its keywords, report it to Gentoo bug 160519 and work around it by using*
. An asterisk will also accept an ebuild with empty keywords. - user mask
- Either remove your
package_mask.conf
entry or override it withpackage_unmask.conf
. - profile mask
- Override with
package_unmask.conf
. - repository mask
- Override with
package_unmask.conf
. - eapi
- You cannot override this mask. It indicates either a broken ebuild (if
EAPI=unknown
) or an ebuild not supported by your current version of Paludis. - license
- Accept the appropriate licences in
licenses.conf
. - by association
- Unmask the associated package. This mask reason is currently only used for old style virtuals.
Sync from CVS
Syncing from CVS requires use of either the cvs+pserver
or the cvs+ssh
protocol.
The syntax for the configuration file line is
sync = cvs+ssh://username@host:/path/to/cvsroot:modulename
. As an example,
for syncing with the gentoo
repository via CVS, you would use
sync = cvs+ssh://username@cvs.gentoo.org:/var/cvsroot:gentoo-x86
.
Sync from a Gentoo tree snapshot
Syncing from a tarball requires the tar+http
or tar+ftp
protocol. You must also
specify sync_options = --strip-components=1
, as the
Gentoo snapshots place everything under a subdirectory
named portage
. For example:
# Replace this with your favourite Gentoo mirror sync = tar+ftp://my.favourite.mirror/gentoo/snapshots/portage-latest.tar.bz2 sync_options = --strip-components=1
Recover VDB
If you deleted /var/db/pkg
by accident, you're pretty much screwed. So don't do that, and be more
careful next time.
If you deleted /var/db/pkg
on purpose, please install OS X and stop pestering us.
Remove Portage from my Gentoo installation
The short answer is that you can't.
Several Gentoo packages wrongly depend on Portage, several depend on Portage because they use it and there really is no reason to try. Just leave Portage installed.