Gentoo

Update System:

emerge sync
emerge --pretend --deep world
(/var/cache/edb/world)

Install Package foo:

emerge --pretend foo

Remove Package foo:

emerge --pretend unmerge foo
emerge -pC foo

Remove old Packages:

emerge --pretend prune
emerge --update --deep --newuse world
emerge --depclean
revdep-rebuild

Rebuild Package foo:

emerge --pretend -emptytree foo
emerge -pe foo

Rebuild the Whole System:

emerge --pretend -emptytree -update world
emerge -peu world

Search for Package foo:

emerge --searchdesc search foo
emerge -Ss foo

Which Package owns the file /bin/foo:

(emerge gentoolkit)
-qpkg --find-file /bin/foo
qpkg -f /bin/foo-
equery belongs /bin/foo

List all Installed Packages:

(emerge gentoolkit)
emerge --pretend --emptytree --verbose --deep world
emerge -pevD world
-qpkg -I-
equery list --installed

Which Packages Depend on Package foo:

equery list -p foo

Statistics about the Compile Times

genlop -t  mozilla-firefox

Additional Informations:

Unofficial portage introduction. Official emerge user guide.