Portage SQLite Cache
Using SQLite for the cache backend can significantly speed up dependency calculations when running Emerge. This article explains how to enable the Portage SQLite cache backend.
Contents |
[edit] Required Packages
You will need to build dev-lang/python with the sqlite USE flag enabled or install the Python SQLite wrapper dev-python/pysqlite:
[edit] Configuration
Next we need to tell Portage to use the SQLite backend, this we do in /etc/portage/modules:
portdbapi.auxdbmodule = cache.sqlite.database
In addition, if you're using a Portage version later than sys-apps/portage-2.1.6.4 you'll need to add metadata-transfer to FEATURES:
...
FEATURES="${FEATURES} metadata-transfer"
...
[edit] Regenerate Cache
Before you generate the Portage SQLite cache, remove the old cache:
Now regenerate the cache:
[edit] eix
If you want eix to be able to use the SQLite backend you'll need to enable SQLite in Portage first (see above) and emerge app-portage/eix with the sqlite USE flag enabled. Depending on the metadata your local and layman overlays provide, the sqlite option might not work, so if you're experiencing errors, omit the OVERLAY_CACHE_METHOD variable. Configure eix to use SQLite:
... PORTDIR_CACHE_METHOD='sqlite' OVERLAY_CACHE_METHOD='parse' # changed to parse. Otherwise eix doesn't show the overlay of an ebuild ...
Finally update eix cache by running eix-update for versions of eix newer than 0.17.0, or update-eix for previous ones.
[edit] Troubleshooting
[edit] ImportError: No module named pysqlite2
When making a major update of Python (like from 2.5 to 2.6) or anything that breaks SQLite (such as dev-libs/icu) you will get the error message:
"ImportError: No module named pysqlite2"
while using emerge or python-updater. You'll have to disable the SQLite module commenting the line you added in /etc/portage/modules and run:
You can now uncomment the lines in /etc/portage/modules and redo the Regenerate Cache part of this article.