Gentoo Logo
Gentoo Logo Side

Gentoo Linux Frequently Asked Questions

Content:

1. Featured Questions

Getting Started 

Installation 

Package Management 

Usage 

Maintenance 

Development 

Resources 

2. Getting Started

How is Gentoo pronounced, and what does it mean? 

A Gentoo is a species of a small, fast penguin, pronounced "gen-too" (the "g" in "gentoo" is a soft "g", as in "gentle"). The latin name of the Gentoo penguin is Pygoscelis papua. The name Gentoo has been given to the penguin by the inhabitants of the Falkland Islands.

What makes Gentoo different? 

Gentoo uses a BSD ports-like system called Portage. Portage is a package management system that allows great flexibility while installing and maintaining software on a Gentoo system. It provides compile-time option support (through USE flags), conditional dependencies, "fake" installs, safe installation (through sandboxing) and uninstallation of software, system profiles, configuration file protection amongst several other features.

With Gentoo you can build your entire system from source completely using your choice of optimizations. You have complete control over what packages are or aren't installed. Gentoo provides you with numerous choices so you can install Gentoo to your own taste. This is why Gentoo is called a meta-distribution.

Gentoo is very actively developed. Not only the ebuilds themselves (the package format Gentoo uses) but the entire distribution uses a rapid pace development style. Patches to the packages are quickly integrated in the mainline tree, documentation is updated on daily basis, portage features are added frequently, releases succeed each other quickly, ...

3. Installation

I'm finding things to be really unstable and I'm using "-O9 -ffast-math -fomit-frame-pointer" optimizations. What gives?  

Don't bother using anything higher than -O3 since it isn't supported by current versions of gcc. Very aggressive optimizations sometimes cause the compiler to streamline the assembly code to the point where it doesn't quite do the same thing anymore.

Please try to compile with CFLAGS -march= -O2 first before reporting a bug.

How can i change the root (or any other user's) password? 

You can use passwd to change the password for the user you are logged into. For extra options and setting, please see man passwd once you've completed the install.

How do i add a normal user? 

The command adduser gentoo will add a user called gentoo. The next step is to give this user a password and passwd will do exactly that.

Instead of adduser you can also use:

Code Listing 3.1: Using useradd

# useradd gentoo -m -G users,audio,wheel -s /bin/bash

This will add a user gentoo, will make possible for him to use sound-related devices (/dev/sound/*), will make possible for him to switch to root (using su) and will make /bin/bash his/her login shell.

You can also install superadduser using emerge superadduser and then issue superadduser gentoo to add a user called gentoo. Just follow the instructions given to you by superadduser.

Why can't a user su to root? 

For security reasons, users may only su to root if they belong to the wheel group. To add a username to the wheel group, issue the following command as root:

Code Listing 3.2: Adding a user to the wheel group

# gpasswd -a username wheel

How to I disable devfs? 

If you plan on using Gentoo with the "old-style" /dev approach, you can disable devfs by passing the gentoo=nodevfs to the kernel. If on the other hand you want to use udev (2.6 kernels only), you can disable devfs by passing the devfs=nomount option to the kernel. Don't forget to read up on our udev guide too.

Can I upgrade Gentoo from one release to another without reinstalling?  

In fact there is no difference between the various releases after they have been installed. Gentoo 1.4 and later are glibc-2.3.x based. As such running emerge --sync; emerge -u world will bring your entire system up to speed with the "latest Gentoo". The true differences between individual releases lie in the installation.

More information can be found in our Gentoo Upgrading Guide.

My kernel doesn't boot (properly), what should I do now? 

You don't need to redo every step of the installation, but only the kernel-stuff and all associated steps. Suppose you have installed Gentoo on /dev/hda1 (/boot) and /dev/hda3 (/) with /dev/hda2 being the swap space:

Code Listing 3.3: Reconfiguring the kernel

Boot from the LiveCD and wait until you receive a prompt
We first mount all partitions:
# mount /dev/hda3 /mnt/gentoo
# mount /dev/hda1 /mnt/gentoo/boot
# swapon /dev/hda2
# mount -t proc none /mnt/gentoo/proc
Then we chroot into our Gentoo environment and configure the kernel:
# chroot /mnt/gentoo /bin/bash
# env-update && source /etc/profile
# cd /usr/src/linux
# make menuconfig
Now (de)select anything you have (de)selected wrongly at your
previous attempt. Then quit and compile your kernel:
# make dep && make bzImage modules modules_install
Now copy over your bzImage file, overwriting your previous one:
# cp arch/i386/boot/bzImage /boot
If you use LILO, rerun lilo -- GRUB users should skip this:
# /sbin/lilo
Now exit the chroot and reboot.
# exit
# umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo
# reboot

If on the other hand the problem lays with your bootloader configuration, follow the same steps, but instead of configuring/compiling your kernel you should reconfigure your bootloader (recompilation isn't necessary).

My proxy requires authentication, what do I have to do? 

When you have to download something using wget, use the following syntax to authenticate yourself:

Code Listing 3.4: Proxy-authentication using wget

# wget --proxy-user=username --proxy-passwd=password <url>

To have Portage automatically use this scheme, define it in /etc/make.conf:

Code Listing 3.5: /etc/make.conf

FETCHCOMMAND="wget --proxy-user=username --proxy-passwd=password -t 5 --passive-ftp -P \${DISTDIR} \${URI}"
RESUMECOMMAND="/usr/bin/wget --proxy-user=username --proxy-passwd=password -c -t 5 --passive-ftp -P \${DISTDIR} \${URI}"

Sadly, rsync doesn't seem to support username/password authentication for proxies. See What if rsync doesn't work for me? for more information on how to handle this situation.

How do I burn an ISO file? 

You need to burn the file in so-called raw mode. This means that you should not just place the file on the CD, but interpret the file as an entire CD.

There are lots of CD burning tools available; covering them all would be a Sisyphean problem. Describing a few popular tools however doesn't hurt :)

  • With EasyCD Creator you select File, Record CD from CD image. Then you change the Files of type to ISO image file. Then locate the ISO file and click Open. When you click on Start recording the ISO image will be burned correctly onto the CD-R.
  • With Nero Burning ROM, cancel the wizard which automatically pops up and select Burn Image from the File menu. Select the image you want to burn and click Open. Now hit the Burn button and watch your brand new CD being burnt.
  • With cdrecord, you simply type cdrecord dev=/dev/hdc (replace /dev/hdc with your CD-RW drive's device path) followed by the path to the ISO file :)
  • With K3B, select Tools > CD > Burn Image. Then you can locate your ISO file within the 'Image to Burn' area. Finally click Start.
  • With Mac OS X Panther, launch Disk Utility from Applications/Utilities, select Open from the Images menu, select the mounted disk image in the main window and select Burn in the Images menu.
  • With Mac OS X Jaguar, launch Disk Copy from Applications/Utilities, select Burn Image from the File menu, select the ISO and click the Burn button.

4. Package Management

In what format are the packages stored? 

They exist in our portage tree as ebuild autobuild scripts; Gentoo is primarily a ports-based distribution, meaning that we provide scripts (.ebuild files) and a special system (Portage) so that you can build apps from sources. We generally only build binaries for releases and snapshots. The Development HOWTO covers the contents of an ebuild script in detail. For full binary ISO releases, we create a full suite of binary packages in an enhanced .tbz2 format (.tar.bz2 compatible with meta-information attached to the end of the file).

I want to perform the ./configure step myself. Can I? 

Yes, but it is not trivial, and the next method only works when it is a simple ebuild (i.e. just ./configure and make && make install). Be sure to read the ebuild itself to see how Gentoo handles it.

Start with unpacking the ebuild: ebuild /usr/portage/<category>/<package>/<ebuild> unpack.

Next, go to /var/tmp/portage/<package>-<version>/work. Inside it you'll find the unpacked sources. Execute the steps you need to perform to configure and compile the package.

When finished, execute touch /var/tmp/portage/<package>-<version>/.compiled to trick Portage into thinking it configured and compiled the package. Then finish up with ebuild /usr/portage/<category>/<package>/<ebuild> merge.

What if rsync doesn't work for me? 

If you're behind a firewall that doesn't permit rsync traffic, then you can use emerge-webrsync which will fetch and install a Portage snapshot for you through regular HTTP. emerge-webrsync uses wget to download, so proxy is fully supported.

Code Listing 4.1: Using emerge-webrsync

# emerge-webrsync

How do I use emerge from behind a firewall? 

Edit the PROXY settings in /etc/make.conf. If that doesn't work, edit /etc/wget/wgetrc and edit http_proxy and ftp_proxy appropriately.

Can I rsync from another operating system? 

There's a program called unison that works under both UNIX and Win32, available from http://www.cis.upenn.edu/~bcpierce/unison/.

I have only slow modem connection at home. Can I download sources somewhere else and add them to my system?  

Definitely. You can run emerge --pretend package to see what programs are going to be installed. To find out the sources for those packages and where to download the sources from, you can run emerge -fp package. Download sources and bring them on any media home. Put the sources into /usr/portage/distfiles and run emerge package to see it picking up the sources you just brought in!

.tar.gz sources for installed software are piling up in /usr/portage/distfiles/ using valuable space. Is it safe to delete these files?  

Yes, you can safely delete these files. But if you are on a slow connection, such as a modem, you might want to keep the archives if possible; often several ebuilds will be released for the same version of a specific piece of software - if you have deleted the archive and you upgrade the software it will have to be downloaded from the internet again.

What's in /var/tmp/portage? Is it safe to delete the files and directories in /var/tmp/portage?  

During compilation, Gentoo saves the sources of the package in /var/tmp/portage. It is safe to clean out all contents of this directory.

5. Usage

I have installed openssh on my box, but can only log in as root - my normal user account doesn't work.  

This is most probably because your user account doesn't have a valid shell specified. Check for your user entry in /etc/passwd and see if it ends in /bin/bash (or any other shell). If it doesn't, you must set a shell for the user. This is done using the usermod command, like this:

Code Listing 5.1: Using usermod

# usermod -s /bin/bash myuser

I can start X applications as root only. 

Your /tmp directory has the wrong permissions (it needs the sticky bit set). Type the following as root:

Code Listing 5.2: Changing /tmp permissions

# chmod 1777 /tmp

How do I set up an International Keyboard Layout? 

Edit the KEYMAP variable in /etc/rc.conf. Then either reboot or restart the keymaps script: /etc/init.d/keymaps restart.

DNS name resolution works for root only. 

/etc/resolv.conf has the wrong permissions; chmod it as follows:

Code Listing 5.3: Changing permissions on /etc/resolv.conf

# chmod 0644 /etc/resolv.conf

Why can't my user use their own crontab? 

You need to add that user to the cron group.

How do I get numlock to start on boot? 

If you log on graphically, or want numlock to be activated when you issue startx, then you must emerge numlockx and add /usr/X11R6/bin/numlockx to /etc/X11/xinit/xinitrc (for startx) or /etc/X11/Sessions/ (for any graphical login manager) such as /etc/X11/Sessions/Gnome for GDM.

GNOME 2.6 users however will notice that this doesn't work. Instead, they will need to start the gnome-session-properties tool. At the top of the Window, select Startup Programs and click the Add button. Now insert the location of the numlockx tool (for instance /usr/X11R6/bin/numlockx) and exit.

If you work in commandline, you only need to rc-update add numlock default and numlock will be activated on the next reboot.

How do I have my terminal cleared when I log out? 

To have your terminal cleared, add clear to your ~/.bash_logout script:

Code Listing 5.4: Clearing the terminal during logout

$ echo clear >> ~/.bash_logout

If you want this to happen automatically when you add a new user, do the same for the /etc/skel/.bash_logout:

Code Listing 5.5: Making new users their terminal clear on logout

# echo clear >> /etc/skel/.bash_logout

6. Maintenance

ReiserFS and filesystem corruption issues -- how to fix'em, etc 

If your ReiserFS partition is corrupt, try booting the Gentoo Linux boot CD and run reiserfsck --rebuild-tree on the corrupted filesystem. This should make the filesystem consistent again, although you may have lost some files or directories due to the corruption.

Metalogd doesn't log in real time! 

Metalog flushes output to the disk in blocks, so messages aren't immediately recorded into the system logs. If you are trying to debug a daemon, this performance-enhancing behavior is less than helpful. When your Gentoo Linux system is up and running, you can send metalog a USR1 signal to temporarily turn off this message buffering (meaning that tail -f /var/log/everything/current will now work in real time, as expected) and a USR2 signal to turn buffering back on again. If you want to disable buffering permanently, you can change METALOG_OPTS="-B" to METALOG_OPTS="-B -s" in /etc/conf.d/metalog.

Code Listing 6.1: Turning metalog buffering on/off

// To turn the buffering off:
# killall -USR1 metalog
// To turn the buffering back on:
# killall -USR2 metalog

7. Development

Where can I report bugs? 

For bugs within a specific program, contact the program's author. Otherwise, use our Bugzilla bug tracker at http://bugs.gentoo.org. You can also visit us in #gentoo on the FreeNode IRC network.

How often are new releases made? 

New releases are announced on the gentoo-announce mailing list. In reality the packages themselves are updated shortly after the main authors release new code. As for when Gentoo makes new releases, check our Release Engineering Project page.

How can I add a question or answer to this FAQ? 

Submit a new bug over at http://bugs.gentoo.org and add it to the "Docs-user" product, "Gentoo Linux FAQ" component.

My speaker beeps like crazy while compiling Mozilla. How do I disable console beeps?  

Console beeps can be turned off using setterm, like this:

Code Listing 7.1: Using setterm

# setterm -blength 0

If you would like to turn off the console beeps on boot you need to put this command in /etc/conf.d/local.start. However, this only disables beeps for the current terminal. To disable beeps for other terminals, pipe the command output to the target terminal, like this:

Code Listing 7.2: Using setterm (bis)

# setterm -blength 0 >/dev/vc/1

You need to replace /dev/vc/1 with the terminal you would like to disable console beeps for.

8. Resources

Where can I find more information about Gentoo Linux? 

The official Gentoo documentation can be found on http://www.gentoo.org; general Linux information is at http://www.tldp.org.

Can I buy a CD of Gentoo Linux? 

Yes! LiveCDs for all supported architecture are available on our Gentoo Store. When you purchase a CD from our store, you are also supporting our development. So, please consider buying from our store if possible :-)

You can also find fresh CDs from tuxcds for a very good price. These people also bounce back a portion of the profits to the Gentoo project, so buy them while they are hot!

Why, when I hit reply to a post on a Gentoo mailing list, does my answer only go to the original poster and not the entire list?  

The mailing list administrators have decided to go with minimal munging (altering of mail headers), which means that they have decided against altering headers to have replies go to the mailing list. There are various reasons for this. For example, if a subscriber has a full mailbox, the entire list receives notice of this every time that something is posted.

Most GUI based mailers have a "reply to all" function. This will ensure that your reply goes to the mailing list as well as the original poster. Most users of text based emailers already know the methods to use, but if you don't, in Pine, there is a "reply to group" option. Setting Mutt to reply to the list is covered in the unofficial documentation at forums.gentoo.org.

Some list members do not like this method, but it was very heavily discussed when it went into effect, with arguments on both sides. Eventually the list administrators decided to keep it this way. Discussing it on the mailing list will sometimes bring a polite explanation and other times a rather brusque comment to check the archives. Although the administrators regret the inconvenience that it may cause some users, it is felt that at present it is preferable to the alternative for several reasons, many of these covered here.

(There are other eloquent arguments in favor of munging, and yes, the list administrators have seen them).

This FAQ hasn't answered my question. What do I do now? 

A good first step is to browse through the relevant documentation, failing that, the various Gentoo Linux mailing lists listed on Google. To search through the Gentoo mailing lists, just enter "lists.gentoo.org foo" to search for "foo". If all else fails, or you just want to hang out with Gentoo folks, visit us on irc: #gentoo on irc.freenode.net.


The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.
Print
line
Updated October 2, 2004
line
Daniel Robbins
Previous Chief Architect

Colin Morey
Reviewer

John P. Davis
Editor

Eric Stockbridge
Editor

Stoyan Zhekov
Editor

Carl Anderson
Editor

Jorge Paulo
Editor

Sven Vermeulen
Editor

line
Summary:  This FAQ is a collection of questions and answers collected from the gentoo-dev mailing list and from IRC -- if you have any questions (or answers!) to add, please contact either an author or a member of the documentation team.
line
The Gentoo Linux Store
line
Copyright 2001-2004 Gentoo Foundation, Inc. Questions, Comments, Corrections? Email [email protected].