Installation
What is the difference between the .iso and .tbz2 files?
The build .tbz2 file is a minimal set of system files
that is necessary for allowing a user to bootstrap and install
Gentoo Linux. The build .iso is a complete, bootable CD image that
contains a system kernel, a reasonably complete set of kernel modules,
necessary system tools such as mkfs and networking support,
as well as the .tbz2 minimal-system tarball. Most users will install
Gentoo Linux by burning the .iso file onto a CD, booting off of the CD,
and installing from within the minimal linux environment provided by
the Gentoo boot CD. It is possible, however, for users to install
Gentoo Linux directly from an already-existing Linux distribution.
Such users need only download the .tbz2 file, install the contents
on a spare partition (making sure to use the p flag when
untarring the tarball!), chroot, and install in the usual fashion.
Why do the build .iso and .tbz2 files sometimes have different -r (revision)
numbers?
The .tbz2 minimal-system tarball only needs to be revised when there have
been significant changes to the core Gentoo Linux system (such as baselayout
changes, or a new profile), and as such .tbz2 updates are relatively rare.
The .iso file tends to get updated whenever we discover that somebody has
hardware that won't boot from our .iso. Since new kernel modules and
patches are constantly being generated, this situation probably won't
stabilise anytime soon.
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 support 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. A possible setting based on Loc-Dog
(on IRC)'s CFLAGS is -O3 -mcpu=i686 -march=i686 -fforce-addr
-fomit-frame-pointer -funroll-loops -frerun-cse-after-loop -frerun-loop-opt
-falign-functions=4, which is about as much as I'd want to push global
optimization settings. Beyond this, it's best to use ultra-high optimizations
only with specific packages where you really need that extra 2%, (eg graphics
and various multimedia programs), and where you can easily test the package
to ensure that it hasn't been optimized into oblivion.
Please try first to compile with CFLAGS -march= -O2 before reporting a
bug.
What's the default root password after installation?
The default password is blank; hit enter.
How can i change the root (or indeed 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:
# 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 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:
# usermod -G users,wheel username
How do I enable devfs?
If you're using 1.0_rc5 or greater, you don't need to do anything special to
get devfs working; it's already active (you did make sure that devfs was built
into the kernel, didn't you?). However, if you are using a version of Gentoo
Linux prior to version 1.0_rc5, add devfs=mount to your
GRUB kernel boot options so that the line looks something like
kernel /boot/boot/bzImage devfs=mount foo=bar The kernel will then
mount the /dev devfs filesystem automatically at boot-time.
How to I disable devfs?
Under Gentoo Linux 1.0_rc6 and later, you can disable devfs by passing the
gentoo=nodevfs to the kernel.
How do I get a /dev/mouse that doesn't go away when I reboot
(when using devfs)?
If you are using 1.0_rc6 or later, then you can just use ln -s
to make the usual symbolic link from /dev/mouse, and
it will be preserved between reboots.
All other users need to edit /etc/devfsd.conf and add these
lines:
REGISTER ^misc/psaux$ CFUNCTION GLOBAL symlink misc/psaux mouse
UNREGISTER ^misc/psaux$ CFUNCTION GLOBAL unlink mouse
If you are not using the devfs PS/2 mouse /dev/misc/psaux device,
adjust the misc/psaux strings above accoringly. You'll then want to
killall -HUP devfsd to get devfsd to reread
/etc/devfsd.conf.
Grub can't find stage x.y?
During installation the grub boot files are copied to /boot/grub
(/boot/boot/grub in Gentoo Linux 1.0_rc5 and earlier.) Grub
automatically looks in the /boot/grub directory on the boot
partition. (We strongly recommend having a separate no-auto boot partition
mounted at /boot, since that way it is much more difficult to
clobber your kernel and boot info by accident.) The above error generally
arises from (a) not using a separate boot partition, (b) forgetting to mount
the boot partition at /boot before either unpacking the build
snapshot or running emerge --usepkg system, or (c) forgetting the
notail option when mounting a ReiserFS /boot partition.
You can get more information on grub, including how to debug grub from the
grub prompt, by reading the IBM developerWorks Grub tutorial.
My ASUS CUV4X-D won't boot and it freezes during various stages of kernel
loading and hardware detection.
Disable MPS 1.4 (multi-processor-system) in the BIOS or switch this
function to 1.1. By using this option you just switch the MPS version. The
Multi-Processor-System will still work properly. Make sure to boot Gentoo
Linux with the following boot option, noapic.
If I have Gentoo 1.4_rc1 can I upgrade to 1.4_rc2, 1.4_final/_rc3 without
reinstalling?
In fact there is no difference between the 1.4 releases after they've
installed. Gentoo 1.4 and later are glibc-2.3.x based. As such
1.4rc1 machine for example, that does emerge sync; emerge -u world is
exactly the same as a machine with 1.4rc2 installed, after it does
emerge sync; emerge -u world. The true differences lie in the installer.
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:
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:
# wget --proxy-user=username --proxy-passwd=password <url>
To have Portage automatically use this scheme, define it in
/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.
Package Management
In what format are the packages stored?
They exist in our portage tree as ebuild autobuild scripts; we are
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).
Why write a new port system (Portage) instead of using BSD's version?
In one sentence, because Portage is much better in so many ways. One of the
design philosophies of the .ebuild syntax was to make it an analog of
what you'd type to install the program manually, thus making Portage very easy
to learn and modify to your needs. We also have OpenBSD-style "fake" installs,
safe unmerging, system profiles, package masking, a real dependency system,
and lots of other good stuff.
How does this differ from Debian's apt or BSD's ports?
Portage features the best of apt and ports; for example, USE options, a full
dependency system, safe installs and uninstalls, and a true package database.
Think of Portage as the best of both worlds; a ports system with the
sensibilities and safety of a Linux package management system built-in.
How do I install and uninstall packages?
The Portage User Guide details how
to install and uninstall packages, and update Portage.
How can I set a global configuration for compiling packages?
/etc/make.conf should be modified to override global and
profile-specific default options used to compile and merge packages. The most
common options are as follows:
| Flag |
Description |
CHOST
This sets the HOST variable for compiles, e.g. i686-pc-linux-gnu
CFLAGS
The options for gcc when compiling programs written in C (*.c files)
CXXFLAGS
The options for gcc when compiling programs written in C++ (*.c,
*.cpp etc. files)
USE
This allows you to set what optional components you'd like compiled-in, if
available. For example, if you have gnome inside the USE string,
then when you compile xchat, it will include GNOME support. All
our dependencies are also USE-aware.
GENTOO_MIRRORS
A space separated list of URIs currently mirroring the Gentoo packages.
Portage will attempt download from a GENTOO_MIRROR first before
trying the official SRC_URI. To force Portage to skip mirrors,
set this variable to "".
What happened to /etc/make.defaults?
As of Portage 1.5 onwards, /etc/make.defaults is antiquated;
if you have portage-1.5-r1 or above installed then you can safely delete it.
This file has been replaced by /etc/make.profile/make.defaults
(/etc/make.profile should actually be a symlink to,
/usr/portage/profiles/default),
which contains system profile-specific default settings. The priority order of
the various configuration files is as follows (highest first):
- Environment variables
- /etc/make.conf, for your use
-
/etc/make.profile/make.defaults, for profile-specific defaults
-
/etc/make.globals, for global defaults (settings not specified
in any other place come from here)
Is there a way to upgrade all installed packages e.g. apt-get upgrade
or make World?
YES! Type emerge --update system (use it with --pretend
first) to update all core system packages, and use emerge --update world
(again, use it with --pretend first) to do a complete system upgrade of
all installed packages.
When updating a package using emerge or ebuild, how do I avoid
clobbering my config files?
Portage now includes config file management support by default. Type
emerge --help config for more details. The (overly) simple answer is
that if a package installs foo somewhere under /etc,
and another foo already exists there, then the new foo
will instead be renamed to ._cfgxxxx_foo in that directory. A
useful tool for examining and updating any protected config files is
etc-update, which is now part of Portage.
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.
# emerge-webrsync
If you cannot do this either, you can manually download a snapshot
from http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/.
In order to install the snapshot correctly, you first need to remove
your current /usr/portage so that outdated ebuilds don't
stay available on your system. However, you might want to put
/usr/portage/distfiles somewhere safe if you don't want to
lose all your sourcecode.
(First download the snapshot and place it in /usr)
# cd /usr
# mv /usr/portage/distfiles /usr/distfiles-temp
# rm -rf /usr/portage
# tar xvjf portage-foo.tbz2
# mv /usr/distfiles-temp /usr/portage/distfiles
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.
I went to emerge blackdown-jdk and blackdown-jre, and afterwards
java-config --list-available-vms would only list blackdown-jre.
Openoffice would then refuse to emerge. What do I do?
Solution:
# emerge unmerge blackdown-jre blackdown-jdk
# CONFIG_PROTECT="" emerge blackdown-jdk
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.
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:
# 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:
# 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:
# chmod 0644 /etc/resolv.conf
Why is KDE not reading /etc/profile?
You need to add --login to the first line in
/opt/kde2.1/bin/startkde, so that it reads as follows:
#!/bin/sh --login
This fix has been added to recent versions of KDE.
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.
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:
$ 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:
# echo clear >> /etc/skel/.bash_logout
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.
How to I view the timestamps in /var/log/syslog.d, etc. on a pre-1.0_rc5
Gentoo system?
To view multilog (Gentoo Linux 1.0_rc5 and earlier) timestamps, you need to
pipe the current log through the tai64nlocalcommand:
# tai64nlocal < /var/log/syslog.d/current | less
Or, alternatively, if you want to "tail" the log:
# tail -f /var/log/syslog.d/current | tai64nlocal
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.
To turn the buffering off:
# killall -USR1 metalog
To turn the buffering back on:
# killall -USR2 metalog
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 new Cd images etc are released, that
tends to be whenever there are any major updates to the base code, or when
new modules get added.
I would like a package to be added to Portage; how would I go about this?
Head over to http://bugs.gentoo.org and submit a new bug of the type
"ebuild". Attach your ebuild to the bug report.
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.
make -f Makefile.cvs on a KDE app produces "invalid unused variable" errors
Export WANT_AUTOMAKE_1_4=1 for all KDE projects before running
make -f Makefile.cvs. Also, for KDE2 apps export
WANT_AUTOCONF_2_1=1, and for KDE3 apps export WANT_AUTOCONF_2_5=1.
My speaker beeps like crazy while compiling Mozilla. How do I disable console
beeps?
Console beeps can be turned off using setterm, like this:
# 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:
# setterm -blength 0 >/dev/vc/1
You need to replace /dev/vc/1 with the terminal you would like to disable
console beeps for.
Resources
Where can I find more about supervise used by default in Gentoo Linux 1.0_rc5
and earlier?
http://cr.yp.to/daemontools.html
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
Cheapbytes
and
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.