User:Genr8/InstallSheet

From Gentoo Wiki
Jump to:navigation Jump to:search

gentoo-installation-instructions-guide-short.txt - Created Saturday 07 September 2024

  • Download a Gentoo Minimal Install CD (or any suitable copy of linux)
  • Boot your computer/VM with it (it should boot to a root prompt and allow networking)
  • Create the disk partitions, manually or use a script:
  • Create the filesystems, ie ext4:
# mkfs.ext4 /dev/sda1 -L boot
# mkfs.ext4 /dev/sda3 -L gentoo
  • Mount the filesystems: (must repeat every reboot)
# mount /dev/sda3 /mnt/gentoo
# mkdir -p /mnt/gentoo/boot (only do once)
# mount /dev/sda1 /mnt/gentoo/boot
# cd /mnt/gentoo
  • Download your particular stage3 now:

Choose the right variant, download the right file <https://gentoo.osuosl.org/releases/amd64/autobuilds/> Save it to [/mnt/gentoo,](file:///mnt/gentoo%2C) (using a browser is OK) With the file in [/mnt/gentoo](file:///mnt/gentoo) and from there, Verify the file (if desired), then

  • Extract the archive (implied to the current dir):
# tar --xattrs-include='*.*' --numeric-owner -xpf stage3*
  • Mount the {proc,sys,dev,run} directories as filesystems:

manual mount commands: (repeat mount script everytime you reboot)

# 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
# mount --bind /run /mnt/gentoo/run
# mount --make-slave /mnt/gentoo/run
  • copy existing DNS resolver over to chroot
# cp /etc/resolv.conf etc
  • ping internet to make sure DNS is valid (if not, add some 8.8.8.8 - googleDNS)
# ping gentoo.org
  • enter chroot & activate profile
# chroot . /bin/bash
# source /etc/profile
  • portage repository download, first sync ( -k to keep)
# emerge-webrsync
  • configure Make.conf
# nano /etc/portage/make.conf to add this line CFLAGS (use COMMON var)
  • Optimize the CPU arch, -march=native by default very early on, to take effect when building new packages
COMMON_FLAGS="${COMMON_FLAGS} -march=native"  #(place after -O2 -pipe line)
  • More Options for Make.conf
#binpkgs - save packages in /var/cache/binpkgs
FEATURES="${FEATURES} buildpkg"
  • Set Timezone
# ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
  • Locale

keep the default C english single locale (otherwise add optional ones to /etc/locale.gen first)

# nano /etc/locale.gen
#(uncomment):
en_US ISO-8859-1
en_US.UTF-8 UTF-8
#(add):
C.UTF8 UTF
  • NLS / Translations
# don't need international language translations
INSTALL_MASK="/usr/share/locale"
USE="-nls" #(causes rebuilds)
  • Install The Kernel

use distribution's premade **sys-kernel/gentoo-kernel-bin** this will install Dracut to make the initramfs and put it with the latest kernel in /boot,

  • make sure /boot is mounted and correctly populated
# ls -al /boot
  • Install Grub Bootloader (to the MBR on the disk here)
# grub-install /dev/sda
  • configure Grub boot menu
# grub-mkconfig -o /boot/grub/grub.cfg
  • Gentoo is now installed!

Reboot into your working system. Handbook Part 1 finished! Continue on to read fully at your own leisure: Working With Gentoo = [Handbook:AMD64/Full/Working] Working With Portage = [Handbook:AMD64/Full/Portage]


Continuing on with the system setup: Things to do in Part 2:

  • make /etc/fstab
# genfstab
  • install two programs for CPU FLAGS customization
# emerge -avt cpuid2cpuflags resolve-march-native
  • passwd - set root password (prompts for pwquality)
# passwd                                                                                                                                              
  • For DHCP

set up network, /etc/conf.d/net , symlink "ln -s net.enp0s3 net.lo"

# emerge dhcpcd                                                                                                                                       
# nano /etc/conf.d/net                                                                                                                                     
config_eth0="dhcp"
For static IP regular                                                                                                                              
config_enp5s0f1="192.168.1.222/24"                                                                                                                    
routes_enp5s0f1="default via 192.168.1.1"                                                                                                             
dns_servers_enp5s0f1="192.168.1.1"
  • Query packages
# emerge -avt gentoolkit portage-utils eix wgetpaste                                                                                                         
  • SSH
# emerge openssh                                                                                                                                        
# rc-update add sshd                                                                                                                                    
# rc-service sshd start 

Note: openssh can not login as root even with key, must create additional user to log in that way -or- edit /etc/ssh/sshd_config

  • USE
# Some use flags from my system (from make.conf)
USE="${USE} -doc -examples -handbook"
USE="${USE} -fonts -themes"
USE="${USE} -nls -firmware -ipv6 -bluetooth -telemetry -wifi -wireless -ppp -modemmanager -cups -gps -geolocation -mono -sendmail -kerberos -ldap"
USE="${USE} -policykit -udisks -pulseaudio -smartcard"
  • Reboot
# reboot
  • Update world packages
# emerge -avuDU @world
  • You're done ! Enjoy Gentoo !