Gentoo - portage usage, tips and tricks

By: John McFarlane <john.mcfarlane@rockfloat.com>
Last updated: 11/18/2005 @ 10:00

Abstract:
This document outlines how to use portage to install things, and keep your setup current on patches.



1. Update your list of packages

Before you ever install something on Gentoo you want to update your list of packages. This is analgous to apt-get -update. Remember that this doesn't install any softare, rather it just updates information about packages:
Perform the update:
root# emerge sync
I recommend running this via cron daily, that way it's always up to date.
I'm finished with this step

2. Update your system - you don't want to get r00ted

Now that you have an up to date Portage tree, you want to update the actual softare on your system.
root# emerge -uDa world
Here's what that means:
  1. emerge (install)
  2. u (update)
  3. D (deep, so dependancies are also used)
  4. a (ask permission before installing!)
What you will see is a list of sofware that is about to be installed. Look thru the list and make sure you are comfortable with everything, and if so.... type y to go ahead and do it, otherwise type n to bail.
I'm finished with this step

3. Check to see if any config files need to be updated

Portage will automatically handle any trivial changes, but sometimes there are changes that you need to manage.
root# etc-update
Here's what you do next:
  1. Look at the list of configuration files it gives you. Look for any config files you care about, or recognize. For example if you run apache or php and there are config files related to either, then manage these first.
    1. Type the number next to the config file
    2. example: 4 This will select this particular config and present you with a list of the differences (in less)
    3. Hit q to exit less
    4. Now you should see a menu asking what you want to do. Pick...
  2. Once you've dealt with all config's that you care about you can feel free to let the system take care of the rest. Type -3 and it will go thru and replace each config with the updated version. For each one it will prompt to delete the old version, go ahead and hit y for each one.
I'm finished with this step

Changelog: Date Description
11/18/2005 @ 10:00 Initial creation

This document was originally created on 11/18/2005


Disclaimer:
This page is not endorsed by gentoo.org or any other cool cats. Any information provided in this document is to be used at your own risk.