Gentoo

From Cheatsheet

Jump to: navigation, search

Gentoo is really fast, but takes years to compile. You could load Ubuntu 10x while waiting for Gentoo to compile everything. This info is largely based on version 2007.0, with smatterings of 2006.1.

Gentoo is like building Linux by hand from scratch. There are 3 options you can do: stage 1 (compile every infinite variation on everything, starting with the kernel), stage2 which has moderately less evil minutia(sp), most of the time you want stage 3, trust me, unless you're super optimizing.

That gets you your base stuff, then you have the option to load some variation of the base software off the live-cd or get it from the internet, which takes much longer and you have to find a source for it, http://ftp.osuosl.org/pub/gentoo/snapshots I think has what you need. getting it off the internet also makes it take even longer, live-cd is good unless you have a custom install.

Notes
  • average load time with Gnome is somewhere around 8-10 hours, yeeeeahh. The better situation is to load it without a desktop, but then you'll have to find all the init scripts and get them to work later...pick your poison.
  • works best to load off live-cd, the eth0 adapters are problematic, and if they hang, you're screwed somewhere in the long process of the build and must submit to being lashed by a cat of nine tails.
  • there's a good tutorial on building a virtual hosting box here http://gentoo-wiki.com/HOWTO_Linux_Virtual_Hosting_Server
  • there's a bunch of tutorials here http://gentoo-wiki.com/Index:HOWTO
  • there's a tutorial on installing Open-Xchange, and exchange replacement here: http://gentoo-wiki.com/HOWTO_Open-Xchange
  • For instance, to create a user called john who is member of the wheel, users and audio groups, log in as root first (only root can create users) and run useradd:
 useradd -m -G users,wheel,audio -s /bin/bash john
 passwd john
vi /etc/make.conf
add line CONFIG_PROTECT="-*"
this will allow updates to update the config files, saving you from having to do it later
emerge blocked packages first run emerge --pretend world and see what's happening, then you can emerge -C the package that's blocking, and then reinstall it, or just not install the blocked package, but it will snarl if you emerge world :(
emerge gentoo-sources genkernel loads the generic patched kernel source, then run /usr/src/linux-2.xxx/make menuconfig and select your options, then save and run make && make modules_install then run make install, then run genkernel --no-clean --no-bootsplash --no-gensplash --install all (on the menu, you might want to enable security options>other security models><M>Default Linux Capabilities for dazuko)
emerge ntp loads the package ntp
emerge --sync syncs the repo's on the net with what you have in /usr/
emerge --search packagename searches for a legit ebuild for you to install
emerge --update world this takes a reeeally long time, and is best done in an Alt-F2 environment, as terminal doesn't really want to load it seems from the standard desktop, when you're done it will prolly tell you it didn't update some files in /etc/
emerge -C package removes a package, more info here
etc/conf.d/net that's where your network config lives, more here, don't foget to ln -s net.lo net.eth0 in /etc/init.d/ , then /etc/init.d/eth0 stop then start after you make changes
ifconfig eth0 192.168.1.1 broadcast 192.168.1.255 netmask 255.255.255.0 up
route add default gw ${GATEWAY}
sets up your network manually, in case the system hozed it, which is common
vi -w /etc/resolv.conf change your nameservers to whatever
rc-update add amavisd default makes amavisd start on boot/reboot when in the default boot level
useradd -m -G users,wheel -d /home/john -s /bin/bash john create a user called john who is member of the whee and users groups, with a homedir of /home/john
xorgconfig automatically generates a new /etc/X11/xorg.conf http://www.gentoo.org/doc/en/xorg-config.xml