You can download a minimal install iso from here
It is assumed that you have some knowledge of Linux and how hardware is detected.
'#' = Direct command |
Tips:* Once booted into the cd, press CTRL, ALT & F2 and enter
# lspci This lists your hardware, you may need to refer to this later.* Research... Gentoo has a fantastic user community and documentation. If you're using the USB install the root is auto mounted under /mnt/cdrom. |
Hard drive setup:- |
# fdisk /dev/sda
A typical filesystem layout I use is this on an 80Gb drive. Set partition 1 to +100M (boot) Press "t", select partition 4 then enter code 82. # mke2fs -L BOOTFS -t ext4 /dev/sda1 # mke2fs -L ROOTFS -t ext4 /dev/sda2 # mke2fs -L HOMEFS -t ext4 /dev/sda3 # mkswap -L SWAPFS /dev/sda4 # swapon /dev/sda4 # mount -t ext4 /dev/sda2 /mnt/gentoo # mkdir /mnt/gentoo/boot # mount /dev/sda1 /mnt/gentoo/boot # cd /mnt/gentoo |
Stage & Portage installation:- |
# links http://www.gentoo.org/main/en/mirrors.xml (move the highlight bar to the desired URL and hit enter.) Move to releases and hit enter. Select the correct arch (amd64.) Select releases Select your arch and hit enter. (amd64) Select autobuilds hit enter Select current-stage3-amd64-systemd Select the stage file. (stage3-amd64-systemd-YYYYMMDD.tar.bz2) select ok to save. Go up 4 levels Select snapshots Select the most recent file. (portage-YYYYMMDD.tar.bz2) # tar -xjpf stageXXX # tar -xjf portage-XXX -C /mnt/gentoo/usr #nano -w /mnt/gentoo/etc/portage/make.conf press CTRL+X to exit, Y to accept changes and ENTER to save. If you wish to define the CPU arch, please refer to this. Also, please refer to the global useflags that maybe required depending on your end game. # mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf # mount -t proc none /mnt/gentoo/proc # mount --types proc /proc /mnt/gentoo/proc # mount --rbind /sys /mnt/gentoo/sys # mount --make-rslave /mnt/gentoo/sys # mount --rbind /dev /mnt/gentoo/dev # mount --make-rslave /mnt/gentoo/dev # cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf !!!!NOTE: Do not be tempted to add customisation at this stage. It is better to get the base system built, bootable and stable. |
Portage rsync configs are now located in /etc/portage/repos.conf/gentoo.conf
Create the directory: # mkdir /etc/portage/repos.conf Then create gentoo.conf with the content below. [DEFAULT] main-repo = gentoo [gentoo] location = /usr/portage sync-type = rsync sync-uri = rsync://rsync.europe.gentoo.org/gentoo-portage |
Entering the Gentoo Environment:- |
# chroot /mnt/gentoo /bin/bash # env-update # source /etc/profile |
Install the Kernel:- |
# emerge -av gentoo-sources # cd /usr/src/linux # make menuconfig # make && make modules_install # cp arch/x86_64/boot/bzimage /boot/kernel-?.?.?-gentoo-r? # cp .config /boot/config-?.?.?-gentoo-r? |
Note: If unmasking a kernel, ensure you also unmask the linux-headers of the same version. |
Setup root user password:- |
# passwd |
Setup Localtime:- |
# ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime |
Setup FSTAB:- |
# nano -w /etc/fstab
LABEL=BOOTFS /boot ext4 noauto,noatime 1 2 LABEL=SWAPFS none swap sw 0 0 LABEL=ROOTFS / ext4 noatime 0 1 LABEL=HOMEFS /home ext4 noatime 0 1 |
Setup Grub (boot loader):- |
# emerge grub # grub-install /dev/sda # grub-mkconfig -o /boot/grub/grub.cfg !!! NOTE !!! GRUB_CMDLINE_LINUX_DEFAULT="rootfstype=ext4 init=/usr/lib/systemd/systemd" |
install systemd & networkmanager
* you may need to unmerge udev & libudev |
# cd # umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo # reboot |
REBOOT!
Login and enable NetworkManager. systemctl enable NetworkManager Now we have a bootable system, we can squeeze a little more speed from compiling. |
Setup hostname:- |
# hostnamectl set-hostname <hostname> |
Setup keyboard locale:- |
# localectl set-keymap uk |
Network Time:- |
# systemctl enable systemd-timesyncd
Time servers are defined in /etc/systemd/timesyncd.conf. |
Setup system log:- |
# emerge syslog-ng logrotate # systemctl enable syslog-ng@default |
YOU NOW HAVE GENTOO INSTALLED BUT NO GUI OR APPZ... |
Now REBOOT |
Select system profile |
Then execute: # eselect profile list Available profile symlink targets: [1] default/linux/amd64/13.0 [2] default/linux/amd64/13.0/selinux [3] default/linux/amd64/13.0/desktop [4] default/linux/amd64/13.0/desktop/gnome [5] default/linux/amd64/13.0/desktop/gnome/systemd [6] default/linux/amd64/13.0/desktop/kde [7] default/linux/amd64/13.0/desktop/kde/systemd [8] default/linux/amd64/13.0/desktop/plasma [9] default/linux/amd64/13.0/desktop/plasma/systemd [10] default/linux/amd64/13.0/developer [11] default/linux/amd64/13.0/no-multilib [12] default/linux/amd64/13.0/systemd * [13] default/linux/amd64/13.0/x32 [14] hardened/linux/amd64 [15] hardened/linux/amd64/selinux [16] hardened/linux/amd64/no-multilib [17] hardened/linux/amd64/no-multilib/selinux [18] hardened/linux/amd64/x32 [19] hardened/linux/musl/amd64 [20] hardened/linux/musl/amd64/x32 [21] default/linux/uclibc/amd64 [22] hardened/linux/uclibc/amd64 Then execute: # eselect profile set 11 executing: # emerge -uvnD world will install/rebuild the the required packages for that profile. This may take a few hours. |
OK. If everything went to plan you should now have a basic Gentoo installation. Now for the hard bit :D |
These are only my recommendations:- create /etc/locale.gen and add "en_GB.UTF8 UTF-8" # emerge ufed Set any required global use flags via ufed. Some useful ones are: X bluetooth branding cacert cairo consolekit corefonts cups dbus egl evdev flac gd gif gles2 gnome gnome-keyring gnutls gpm gtk icu jpeg jpeg2k ibnotify mmx mp3 mpi nautilus networkmanager offensive office ogg opengl png policykit pulseaudio python qt4 smp sse sse2 sse4 sse4_1 ssse3 svg syslog systemd tiff truetype udev disks usb uxa vhosts vim-syntax vorbis xkb -bindist -ipv6 -widevine If you don't want to set any global flags, you can opt to set these on a per package basis (recommended). If you do define/remove any global flags, ensure you run an "emerge -puvND world" and rebuild any packages. |
Example only:
/etc/portage/package.use/qtwebkit /etc/portage/package.use/iputils /etc/portage/package.use/libpng /etc/portage/package.use/python /etc/portage/package.use/ffmpeg /etc/portage/package.use/libpcre /etc/portage/package.use/qtkeychain /etc/portage/package.use/zlib /etc/portage/package.use/cogl /etc/portage/package.use/mesa |
# emerge -evD system (optional but recommended) [this will rebuild the install for your architecture. It may take a while] #emerge gentoolkit # revdep-rebuild Now it's time to get a GUI installed. |
Install GDM & Gnome |
Install your Desktop Environment.
# emerge av gdm gnome-light Once complete enable gdm to autostart |
Caveats and Cleanups |
Gnome-terminal may not start
# locale-gen And then: # localectl set-locale LANG="en_GB.UTF-8" And reboot. Gnome-shell screen cast may not work. You may get the error: gnome-session[736]: ** (gnome-shell:805): WARNING **: ShellRecorder: failed to parse pipeline: no element "vp9enc" To fix this, ensure that gst-plugins-good, libvpx & ffmpeg are installed. |
There you have it. A full Gentoo Linux install with a Gnome3 desktop.
Time to spend a few more hours emerging your apps: ;)
A few useful apps are:
extundelete app-misc/screen libreoffice (take >1 hour) google-chrome firefox app-admin/keepassx eog gimp vim corefonts linux-firmware dosfstools chrome-binary-plugins gnome-tweak-tool