Speeding Up emerge

When working on NetBeans ebuilds, it’s often about doing some modifications, then emerging the ebuild … and then finding another problem (it’s most often caused by “playing” with dependencies). What speads the emerge up significantly is using tmpfs for /var/tmp/portage, which is the directory where portage compiles application. Using part of your RAM for emerge is also generally useful for any emerge tasks as it makes it work faster. Here is how to use tmpfs for /var/tmp/portage:

mount -t tmpfs -o size=6G,mode=775,uid=portage,gid=portage tmpfs /var/tmp/portage/

Specify size that you want or can afford to share max from your RAM. After this, your emerge commands will be faster because instead of writing files to disk and reading from disk, most of the operations are performed in memory.

If you want to mount it permanently, you can put something like this below to your /etc/fstab file:

tmpfs /var/tmp/portage tmpfs size=6G,mode=775,uid=portage,gid=portage 1 2

This will automatically mount it on each system boot.


Leave a Reply

You must be logged in to post a comment.