Gentoo Linux Step by Step Installation Guide with Screenshots – Part 1

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.

Gentoo Installation Guide

Gentoo Linux Installation Guide

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.

Boot Gentoo Live

Boot Gentoo Live

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.

Gentoo Desktop Login Screen

Login Screen

Open Terminal

Open Terminal

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 broadcast netmask up
# route add default gw
# nano /etc/resolv.conf

Configure Network Connection

Configure Network Connection

Verify Network Connection

Verify Network Connection

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
Create Disk Partitions

Create Disk Partitions

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
Check Disk Partition

Check Disk Partition

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.

Boot Partition
(parted) mkpart primary 21 500
(parted) name 2 boot
Swap Partition
(parted) mkpart primary 501 1501
(parted) name 3 swap
Root Partition
(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.

Final Partition Layout

Final Partition Layout

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
Format Partitions

Format Partitions

Mount Partitions

Mount Partitions

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
Gentoo Mirror List

Gentoo Mirror List

Select Nearest Mirror

Select Nearest Mirror

Select Your Architecture

Select Your Architecture

Select Current Gentoo ISO

Select Current Gentoo ISO

Download Gentoo Stage 3 Tarball

Download Gentoo Stage 3 Tarball

After selecting the Tarball press [Enter] key, select OK, wait for the download to finish and quit links.

Save Gentoo Stage 3 Tarball

Save Gentoo Stage 3 Tarball

Downloading Gentoo Stage 3 Tarball

Downloading Gentoo Stage 3 Tarball

Exit links Window

Exit links Window

12. On the next step, extract Stage 3 Tarball archive using the following command.

# tar xvjpf stage3-amb64-20140522.tar.bz2
Stage 3 Tarball File

Stage 3 Tarball File

Extract Stage 3 Tarball

Extract Stage 3 Tarball

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.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Matei Cezar

I'am a computer addicted guy, a fan of open source and linux based system software, have about 4 years experience with Linux distributions desktop, servers and bash scripting.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide
The Complete Linux System Administrator Bundle
Become an Ethical Hacker Bonus Bundle

You may also like...

13 Responses

  1. maktub says:

    I try “tar xvjpf” not working but tar xpvf working.

  2. Lilian says:

    Step 6.21
    # emerge gentoo-sources
    emerge: there are no ebuilds to satisfy “gentoo-sources”.

    Ce-i de facut?

  3. BORKBORK says:

    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.

  4. Patrick P says:

    What is the su – password???

  5. GNU Rida says:

    Thanks! I used this guide to install Gentoo in the club!

  6. esrin says:

    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?

  7. chaneng says:

    Thanks for posting.
    It was very useful to me.
    I’m not linux specialist, so step-by-step manual is good for beginer.

  8. Chris says:

    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

  9. CJ says:

    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.

  10. Joe says:

    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.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.