Gentoo Portage Cheat Sheet

 

Daily maintenance

Update the Gentoo repository

Gentoo uses rsync to update the repository. Portage proves a front-end for this:

root ~ # emerge --sync

When the connections are restricted by administrators or firewalls, Gentoo repository can be updated by fetching the latest snapshot using:

root ~ # emerge-webrsync

emerge-webrsync also guarantees the signed snapshots are pulled.

Update the system

Gentoo system consists of key applications selected by the users, named @world. @world is updated using:

root ~ # emerge --update --ask @world

To update the dependencies of those packages as well, add the --deep option:

root ~ # emerge --update --deep @world

To update the compile dependencies, add --with-bdeps=y:

root ~ # emerge --update --deep --with-bdeps=y @world

To apply new USE flags, add --newuse:

root ~ # emerge --update --deep --with-bdeps=y --newuse @world

Portage tools

Query the USE flags

Query the flags of <package>:

equery uses <package>

Regenerate world file

World file is located at /var/lib/portage/world.

root ~ # regenworld