Same as Arch Linux, Gentoo is an Open Source meta-distribution build from sources, based on Linux Kernel, embracing the same rolling release model, aimed for speed and complete customizable for different hardware architectures which compiles software sources locally for best performance using an advanced package management – Portage.
Because the final user can choose which components are to be installed, Gentoo Linux installation is a very difficult process for unexperienced users, but this tutorial uses for simplification a pre-build environment provided by a LiveDVD and a stage 3 tarball with minimal system software required to complete installation.
This tutorial shows you a step by step Gentoo installation simplified single-boot procedure, divided into two parts, using a 64-bit image with the last Stage 3 Tarball, using a GPT partition scheme and a customized Kernel image provided by Gentoo developers, so arm yourself with plenty of patience because installing Gentoo can be a long time consuming process.
Step 1: Download Gentoo DVD Image and Prepare Network Configurations
1. Before proceeding with installation go to Gentoo Download page and grab the last released LiveDVD image.
2. After you burn the ISO image place the DVD in your system DVD drive, reboot your computer, select your bootable DVD and Gentoo prompt LiveDVD should appear on your screen. Select the first option (Gentoo x86_64) which boots the default Gentoo Kernel then press Enter key to continue.
3. After Gentoo DVD content is loaded you will be prompted with Gentoo main login screen which provides the default credentials for live session. Press Enter to login then go to KDE start button and open a Terminal window.
4. Now it’s time to check your network configuration and Internet connectivity using ifconfig command and ping against a domain. If you are behind a DHCP server, your network card should be automatically configured for you else use net-setup or pppoe-setup and pppoe-start commands or dhcpcd eth0 (replace it with your NIC plugged cable) in case your NIC has problems with automatically detect DHCP settings.
For static network configurations use the following commands but replace IPs according to your network settings.
$ sudo su - # ifconfig eth0 192.168.1.100 broadcast 192.168.1.255 netmask 255.255.255.0 up # route add default gw 192.168.1.1
# nano /etc/resolv.conf nameserver 192.168.1.1 nameserver 22.214.171.124
Step 2: Create Disk Partitions and Filesystems
5. After you network connectivity has been established and confirmed it’s time to prepare Hard Disk. The following GPT partition layout will be used, but the same partition scheme can be also applied on a MBR BIOS disk using fdisk utility.
/dev/sda1 - 20M size – unformatted = BIOS boot partition /dev/sda2 – 500M size – ext2 filesystem = Boot partition /dev/sda3 - 1000M size – Swap = Swap partition /dev/sda4 - rest of space – ext4 filesystem = Root Partition
To create system disk partition switch to root account and run Parted utility with optimum alignment.
$ sudo su - # parted -a optimal /dev/sda
6. After entering parted CLI interface set GPT label on your hard disk.
# mklabel gpt
7. Use print to show your disk partition current state and remove any partitions (if case) using rm partition number command. Then supply parted with MB or mib size unit, create the first partition with mkpart primary, give it a name and set the boot flag on this partition.
(parted) unit MB (parted) mkpart primary 1 20 (parted) name 1 grub (parted) set 1 bios_grub on (parted) print
The way that Parted deals with partition sizes is to tell it to start from 1MB + the desired value size (in this case start a 1 MB and end at 20 MB which results in a 19 MB partition size).
8. Then create all the partitions using the same method as above.
(parted) mkpart primary 21 500 (parted) name 2 boot
(parted) mkpart primary 501 1501 (parted) name 3 swap
(parted) mkpart primary 1502 -1 (parted) name 4 root
As you can see Root partition uses -1 as maximum value which means that it’s using all the remaining space -1 MB at the end of disk space. After you complete with disk slices use print to see your final partition layout (should look like in the image below) and quit parted.
9. Now it’s time to format partitions using a specific Linux filesystem, activate Swap file and mount Root and Boot partitions to /mnt/gentoo path.
# mkfs.ext2 /dev/sda2 # mkfs.ext4 /dev/sda4 # mkswap /dev/sda3 # swapon /dev/sda3
Step 3: Download and extract Gentoo Stage 3 Tarball
10. Before downloading Gentoo Stage 3 Tarball check your system time and date using date command and, in case, there’s a huge time desynchronization use the following syntax to synchronize time.
# date MMDDhhmmYYYY ##(Month, Day, hour, minute and Year)
11. Now it’s time to download Gentoo Stage 3 Tarball. Proceed to /mnt/gentoo path and use links command to navigate to Gentoo Mirror list and select your Country nearest mirrors -> releases -> amd64 (or your system architecture) -> current-iso -> stage3-cpu-architecure-release-date.tar.bz2.
# cd /mnt/gentoo # links http://www.gentoo.org/main/en/mirrors.xml
After selecting the Tarball press [Enter] key, select OK, wait for the download to finish and quit links.
12. On the next step, extract Stage 3 Tarball archive using the following command.
# tar xvjpf stage3-amb64-20140522.tar.bz2
Now you have a minimal Gentoo environment installed on your computer but the installation process is far from being finished. To continue the installation process follow Install Gentoo Linux – Part 2 tutorial.
14 thoughts on “Gentoo Linux Step by Step Installation Guide with Screenshots – Part 1”
I try “tar xvjpf” not working but tar xpvf working.
# emerge gentoo-sources
emerge: there are no ebuilds to satisfy “gentoo-sources”.
Ce-i de facut?
I’m a Linux noob but Gentoo and Arch Linux just make me barf. It’s easier to to just repackage, re-brand and re-roll your own distro based on an existing one. The amount of time and punishment it takes to learn the Linux kernel, File system, Daemons, Partitions etc.. A newb like me would rather just based a distro on an existing one. It’s cheap, it’s dirty, it’s under handed but it’s free so why not.
What is the su – password???
You need to use the SU or root password. While installing from the USB, cd or DVD, enter the command:
The script will ask you for a new password.
Thanks! I used this guide to install Gentoo in the club!
You forgot to include the step for mounting the partitions. There is just a screenshot but you skipped that step in your guide.
Kinda ruined the whole guide for me because it seemed so thorough that I didn’t question it until I kept running out of space trying to install the kernel and had to go back only to see you completely left that step out. I finally found it in the tiny font of the screenshot.
Good effort though but you should really fix that if you are going to call it an installation guide because without the step it makes it awfully confusing considering there is a step along with each screenshot for everything else. It’s supposed to be an installation guide “with” screenshots, right?
I also have the same problem, is it the mount to /dev/sda4 you’re talking about?
Thanks for posting.
It was very useful to me.
I’m not linux specialist, so step-by-step manual is good for beginer.
Good luck i havent tried gentoo in ages it had an installer back then i believe this was hmm perhaps 7 years ago give or take now i miss it and its capabilities trying it again alongside my windows good luck CJ this guide makes it much easier in case a hiccup browser next to u for reference :) if using live dvd tat is
I’ve attempted to install Gentoo at least a dozen times since 2005 and have met with failure each time. I recently decided to give it another try and I’m going to use your tutorials. Wish me luck.
Wow! Very complicated but much appreciated. I just followed the links in this tutorial, and will do so again for part 2, but I learned a little bit. Thanks for posting this.