Portage SQLite Cache

Using SQLite for the cache backend can significantly speed up metadata transfer, when enabled because of eclass-modifying overlays. This article explains how to enable the Portage SQLite cache backend.

Beware that statements that this would also speed up dependency calculations of Emerge, are not true for everyone. Since the type of file system, fragmentation / physical location, and other factors play a large role in this. Therefore it is recommended to test and compare this yourself, and not blindly believe either side, or even comparison tests on installations that are very different from yours.

Required Packages
You will need to either build with the  USE flag enabled …

… or install the Python SQLite wrapper :

Configuration
Next we need to tell Portage to use the SQLite backend. This we do in :

In addition, if you're using a Portage version later than you'll need to add metadata-transfer to FEATURES:

Regenerate Cache
Before you generate the Portage SQLite cache, remove the old cache:

Now regenerate the cache:

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 with the  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:

Finally update eix cache by running for versions of eix newer than 0.17.0, or  for previous ones.

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  or. You'll have to disable the SQLite module commenting the line you added in and run:

You can now uncomment the lines in and redo the Regenerate Cache part of this article.

SQLite jako pamięć podręczna Portage Размещение кеша Portage в SQLite Portage ile SQLite önbellek