What Is Gentoo Linux and How to Install It

by Lenny Zulauf
30 minutes read

What Is Gentoo Linux and How to Install It

A image of a laptop computer on optimal of a table.

Gentoo Linux is a forceful and extensible distribution that stuck to the initial resource-based methodology administration. Further, its methodology supervisor, portage, is a forceful energy that enables you to okay-track and tweak each distribution component. But, it is not a distribution that is straightforward to gap and usage. Here we underline you how to gap Gentoo Linux to value its countless rewards.

Web content
  • What is Gentoo Linux?
  • Obtaining Gentoo
  • Installing Gentoo Linux

What is Gentoo Linux?

At its core, Gentoo Linux is a disturbingly modular Linux distribution that gives you the power to invent custom-made Linux machines for any unbiased. Assorted other distributions, it executes this by presenting the tools to assembled and readjust every installable methodology in the mechanism.

One of the greatest rewards of this methodology is that it clears the intermediary between you and your mechanism packages. You are not defined for to a details methodology supervisor and app layout. Via the resource code, you can assembled your disturbingly own packages and readjust them to suited your needs.

Obtaining Gentoo

You can recover a xerox of Gentoo from its internet internet site. You can favor the installer for unlike gizmos. Gentoo stabilizes both amd64 and arm64 among other heritage layouts.

Via the downloaded and install ISO record, you can then usage a USB cooking up regiment such as balenaEtcher and dd to invent your bootable flash drive.

Installing Gentoo Linux

In days gone by we perpetuate mounting Gentoo, it is pertinent to tab that this process is only manual, which strategies the majority of commands will most clearly be used along the means. As such, it is prescribed that you not only consult this guide but in addition scrutinize Gentoo’s authorities manual for further recommendations throughout the installation.

A screenshot of the Gentoo Linux Manual webpage for amd64.

Stick your flash drive into your computer and boot it upward. It will most clearly boot you into the Gentoo Installer display screen.

Nice to become aware: Detect out how you can test drive a Linux distro from within your web browser.

Reaction 1: Position Upward the Network Rapport

To gap Gentoo, you have to be connected to the Internet. The installer will most clearly attach easily on a wired relationship. Inspect whether you are currently digital by sprinting the complying with command:

ping -c 5 maketecheasier.com
A incurable evidencing the ping command for MakeTechEasier.com.

If you have to attach to a wireless network, you have to arrange wpa_supplicant, which will most clearly attach you to your wireless access point.

wpa_passphrase 'Your_SSID_Here' 'Your_Password_Here' >> /etc/wpa_supplicant/wpa_supplicant.conf

Reload the dhcpcd daemon to prelude your wireless network relationship:

rc-service dhcpcd restart

Reaction 2: Inventing the EFI Disk Separating

Format the disk you yearn to gap Gentoo on. Tote out that by making earn service of of the fdisk command obeyed by the product record of your computer’s disk:

fdisk /your/disklabel
A incurable evidencing the fdisk command for the /dev/vda product.

If you are vague of your current disk separating frame, scrutinize it via the -l flag:

fdisk -l

Once within fdisk, press G to wipe the disk for any current dividings.

A incurable evidencing the process of clearing a disk separating table.

Press N to educate fdisk that you yearn to invent a brand-neoteric separating. Fdisk will most clearly ask you for the separating number you yearn to usage. Press Get in to usage the default.

A incurable evidencing the evolve of the first separating.

Kind “+100M” on the “Last sector” incite, then press Get in.

A incurable evidencing the process of placement the size of the first separating.

Match the form of your first separating by emboldening T. This will most clearly educate fdisk that you yearn to readjust the form of the separating you merely accumulated. From there, methodology this separating to “EFI Mechanism” by typing 1, then emboldening Get in.

A incurable evidencing the process of placement the form of the first separating.

Reaction 3: Separating the Rest of the Disk

The next separating you have to equip is the “/boot” separating in which the Linux piece and the bootloader will most clearly be preserved. Press N, then Get in to invent your mechanism’s 2nd separating.

Kind “2”, then press Get in to educate Fdisk that you are editing the 2nd separating for the current disk.

A incurable evidencing the evolve of the 2nd separating.

Press Get in to accept the default first sector incentive for the separating, then form “+1G”, then press Get in to methodology the separating size to 1 GB.

A incurable evidencing the process of placement the size of the 2nd separating.

Press N once more, then form “3” to invent the ultimately separating of your hard disk. This will most clearly serve as your machine’s swap separating which can dynamically swap its memory whenever it is sprinting out of gap.

Press Get in to methodology the default first sector incentive, then form “+4G”, then press Get in to methodology the swap separating size to 4 GB.

A incurable evidencing the process of placement the size for the ultimately separating.

Note: The basic dominion for swap size is between 1/2 to 2 times the amount of physical memory in your computer. This strategies that you if you have a 16 GB mechanism, you can methodology your swap between 8 to 32 GB.

Press T, then form “3” to readjust the form of the ultimately separating.

Kind “19” to satisfactorily methodology this separating as swap, then press Get in.

A incurable evidencing the process of placement the form of the ultimately separating.

Concoct the root separating in which the rest of the mechanism will most clearly be mounted. Press N once more, then form “4” to methodology the fourth separating on the disk.

Press Get in on both first sector and last sector prompts to allot the rest of the disk to your root separating.

A incurable evidencing the process of placement the size for the fourth separating.

Press P to scrutinize whether the separating table layout that you made is rectify.

A incurable evidencing the brand-neoteric separating table layout for Gentoo Linux.

Press W to substantiate and write your brand-neoteric separating table to disk.

Reaction 4: Formatting the Disks in Gentoo

Format the EFI Mechanism separating as FAT by making earn service of of the complying with command:

mkfs.vfat /dev/sda1

Concoct the filesystem for the “/boot” separating by making earn service of of the less complex ext2 filesystem.

mkfs.ext2 /dev/sda2

Concoct and make it feasible for the swap separating to educate Gentoo that this separating can be lugged out for exchanging via reside memory. To implement that, run the complying with:

mkswap /dev/sda3 swapon /dev/sda3

Concoct an ext4 filesystem for the root separating by sprinting the complying with command:

mkfs.ext4 /dev/sda4

Reaction 5: Downloading and install the Gentoo Stage 3 Tarball

Install the root separating that you merely made to the “/mnt/gentoo” brochure because the installation will most clearly currently be used in your machine’s hard disk.

mount /dev/sda4 /mnt/gentoo && cd /mnt/gentoo

Download the Stage 3 tarball from the gentoo.org internet internet site making earn service of of wget:

wget https://distfiles.gentoo.org/releases/amd64/autobuilds/20231112T170154Z/stage3-amd64-desktop-openrc-20231112T170154Z.tar.xz
A incurable evidencing the download process for the Gentoo Linux Stage 3 tarball.

Once that is used, unpack it in your “/mnt/gentoo” brochure making earn service of of tar:

tar xpvf ./stage3-amd64-desktop-openrc-20231112T170154Z.tar.xz --xattrs-include='*.*' --numeric-owner

Reaction 6: Pick a Download Mirror and Xeroxing DNS Niceties

Divulge in which you yearn to download your packages for this mechanism by sprinting the mirrorselect command:

mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

This will most clearly responsive a TUI regiment in which you can pick the nearest server locale to you.

A incurable evidencing the obtainable download mirrors for Gentoo Linux.

Xerox the default repository record for Gentoo to your “/and so on/portage” folder. This is a configuration record that educate Portage how to download its packages:

mkdir -p /mnt/gentoo/etc/portage/repos.conf &&        cp /mnt/gentoo/usr/share/portage/config/repos.conf           /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

Xerox the resolver details from your USB installer to the “/mnt/gentoo” brochure:

cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

Reaction 7: Mounting the Devices Files and Chrooting

Install the momentous catalogs from the USB installer to your hard disk:

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

Match the root of your current shell session from the Reside ISO to the “/mnt/gentoo” brochure:

chroot /mnt/gentoo /bin/bash source /etc/profile export PS1="[chroot] ${PS1}"

Reaction 8: Mounting the /boot separating and Modernizing Gentoo

Install the “/boot” separating to your Gentoo machine to warranty that as soon as you gap the piece afterwards that it will most clearly be preserved in the rectify gap:

mount /dev/sda2 /boot mkdir /boot/efi mount /dev/sda1 /boot/efi

Upgrade your Gentoo databases to equip sure you recover the latest packages as soon as you implement the first mechanism upgrade:

emerge-webrsync

Upgrade and gap all the foundation EBUILDS for your mechanism by sprinting this materialize command:

emerge --ask --verbose --update --deep --newuse @world

Reaction 9: Time Zone and Suspensions

Once that is used, arrange your mechanism’s gap-details details which entails both your time zone and mechanism locale. To methodology the time zone to your locale, position the nearest locale to you bet out in the “/usr/share/zoneinfo” folder.

ls /usr/share/zoneinfo

Write the route to the folder and zonefile to your “/and so on/timezone” record. For instance, the nearest locale to me is “Asia/Manila”:

echo "Asia/Manila" > /etc/timezone emerge --config sys-libs/timezone-data
A incurable evidencing the process of placement the mechanism timezone.

Amenable the “locale.gen” record via your favorite message editor:

nano -w /etc/locale.gen

Recover rid of the added pound indication (#) in front of the first 2 nonsenses in the locale.gen record.

A incurable evidencing the process of placement the mechanism locale.

Note: You can note the complete checklist of obtainable stains by sprinting the complying with: cat /usr/share/i18n/SUPPORTED.

Apply your brand-neoteric locale placements by sprinting the locale-gen regiment.

Reaction 10: Installing the Linux Kernel and Configuring the fstab

There are countless strategies to gap the Linux Kernel in Gentoo. Either by hand configure all of its features or usage a pre-constructed one from the Gentoo developers. For our purposes, we are appointing for the latter.

To prelude, gap the installkernel methodology and the piece itself:

emerge --ask sys-kernel/installkernel-gentoo sys-kernel/gentoo-kernel-bin

Nice to become aware: Detect out how you can downgrade your Linux piece in Ubuntu.

Via the piece mounted, responsive the fstab record via your favorite message editor:

nano -w /etc/fstab

Divulge all of the dividings you accumulated in fdisk. For instance, in a UEFI mechanism, your fstab record could look something favor this:

[...]   /dev/sda1    /boot/efi    vfat    defaults    0    2 /dev/sda2    /boot    ext2    defaults,noatime    0    2 /dev/sda3    none    swap    sw    0    0 /dev/sda4    /    ext4    noatime    0    1
A incurable evidencing a unwell fstab separating layout.

Reaction 11: Position Upward the Origin Password and Installing Secondary Devices

Concoct a root password for your mechanism. This will most clearly warranty that you can still access your mechanism after the installation process:

passwd
A incurable evidencing the process of placement a brand-neoteric root password.

Install second network advice tools for your Gentoo mechanism. For instance, if you yearn both Ethernet and wireless relationship, gap the complying with:

emerge --ask net-misc/dhcpcd net-wireless/iw net-wireless/wpa_supplicant rc-update add dhcpcd default

Once used, in addition gap a mechanism logger if you yearn to display screen the practices of your mechanism:

emerge --ask app-admin/sysklogd rc-update add sysklogd default

Ultimately, gap the filesystem powers for the the majority of ordinary filesystems you will most clearly attach via:

emerge --ask sys-fs/dosfstools sys-fs/ntfs3g

Reaction 12: Installing the Bootloader

The final interfere mounting Gentoo is the bootloader. This is a tiny regiment that loads easily after your machine’s BIOS and prepares to loads the OS’ piece.

To gap the GRUB Bootloader, run the complying with command:

emerge --ask sys-boot/grub
A incurable evidencing the process of gaining the Grub bootloader.

Once mounted, run the complying with commands to satisfactorily initialize and configure GRUB:

grub-install --target=x86_64-efi --efi-directory=/boot/efi grub-mkconfig -o /boot/grub/grub.cfg

Unmount the USB installer and reboot the mechanism by sprinting the complying with:

exit cd umount -l /mnt/gentoo/dev{/shm,/pts,} umount -R /mnt/gentoo reboot

Installing Gentoo Linux is merely the first interfere thanks how your Linux distribution works under the hood. Detect out how you can further maximize your mechanism by speeding upward assembled times in Gentoo.

But, if you are still vague which desktop hamlet to gap, scrutinize out what we reckon are the faultless desktop settings on Linux.

Image financial debt: Dell via Unsplash (Background) and Wikimedia Commons (Logo). With one voice alterations and screenshots by Ramces Red.

Related Posts