Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.


Gentoo Linux
Gentoo Linux logo matte
The official Gentoo Linux logo
Release Status Maintained
Release Model Rolling Release / Stable
Package Manager portage
Default Desktops KDE Plasma
Usage Type Desktop, Server
Architectures amd64, alpha, arm, arm64, hppa, ia64, loong, mips, m68k, ppc, riscv, s390, sparc, x86
Website gentoo.org


Gentoo Linux is a highly flexible, source-based Linux distribution founded in 2000 by Daniel Robbins. Known for its emphasis on customization and performance optimization, Gentoo allows users to compile their entire system from source code, providing granular control over system components and features.

Overview

Gentoo stands out for its unique approach to package management and system configuration. Users can fine-tune their installation through compile-time options called USE flags, which determine what features and dependencies are included in each package. This source-based approach, while more time-consuming than binary distributions, enables optimizations specific to the user's hardware and requirements.

Key Features

There are multiple key features that Gentoo allows, by example Gentoo allows the user to completely configure the system as they wish thru source compilation of the packages and the kernel itself. One can choose between OpenRC or Systemd as their init system, but that can also be changed as well if the user has a desire for it. The Operating System itself has extensive hardware and architecture support, the Gentoo Handbook has many officially supported architectures, but the users can opt in for other architectures as well, as Gentoo is very flexible with the software it provides, hence the name "Meta-Distribution".

Gentoo follows the Rolling Release model with stable and unstable branch options, by default all unstable packages (~amd64) are masked, so the user will not accidentally get unstable packages inside their system without their knowledge or approval.

Gentoo has minimal system requirements, the only downside of that being increase compilation time, however Gentoo is very minimal and it allows a lot of flexibility in that regard.

Portage, one of the most key components of Gentoo, allows the user to have super control over the system and packages within it. It allows for easy compilation settings ( USE flags ), monitoring the system packages effectively and letting the user change the system as they desire.

Additionally, Portage allows storing multiple versions of the same package on the system, also called "slotting". As example, the user can download both Python 2 and Python 3, and use them at the same time on different projects.

To manage those multiple versions of the same packages ( slotting ), Gentoo provides a tool called eselect. It acts as a manager for setting system defaults, such as choosing which version of GCC, Python, or even your preferred text editor should be used globally.

Use cases of eselect

Changing the GCC version

[user@hostname ~]$ eselect gcc list
 [1]  x86_64-pc-linux-gnu-13 *
 [2]  x86_64-pc-linux-gnu-14
 
[user@hostname ~]$ eselect gcc set 2

Changing the locale

[user@hostname ~]$ eselect locale list
Available targets for the LANG variable:
  [1]   C
  [2]   C.utf8 *
  [3]   en_US.utf8 
  [4]   POSIX
  [ ]   (free form)
[user@hostname ~]$ eselect locale set 3

Installation

Installing Gentoo requires manual configuration and compilation of the system components. The first step of the installation is to prepare the installation environment, which involves downloading the .iso first. Gentoo allows the following boot medias (amd64);

Minimal Installation CD, QCOW2 disk and LiveGUI USB Image.

The next step involves networking, by default, Gentoo recommends using DHCP to assist in network configuration, and can automatically provide configuration for a variety of parameters, those include but are not limited to: IP Addresses, DNS servers, NTP servers, routes, etc.

After configuring the networking, the user should format the necessary partitions for installing the Operating System on the disk. The user can choose whether to use ext4, btrfs and other file systems.

Once the partitioning is ready, the user will now install the stage file, which include the core of the Gentoo Operating System. The user will have to make a choice between OpenRC and Systemd ( other init systems can be chosen if desired ). Additionally, the user can select different system profiles.

[user@hostname ~]$ eselect profile list
Available profile symlink targets:
  [1]   default/linux/amd64/23.0 (stable)
  [2]   default/linux/amd64/23.0/systemd (stable)
  [3]   default/linux/amd64/23.0/desktop (stable)
  [4]   default/linux/amd64/23.0/desktop/systemd (stable)
  [5]   default/linux/amd64/23.0/desktop/gnome (stable)
  [6]   default/linux/amd64/23.0/desktop/gnome/systemd (stable)
  [7]   default/linux/amd64/23.0/desktop/plasma (stable)
  [8]   default/linux/amd64/23.0/desktop/plasma/systemd (stable)
  [9]   default/linux/amd64/23.0/no-multilib (stable)
  [10]  default/linux/amd64/23.0/no-multilib/systemd (stable)
  [11]  default/linux/amd64/23.0/no-multilib/hardened (stable)
  [12]  default/linux/amd64/23.0/no-multilib/hardened/systemd (stable)
  [13]  default/linux/amd64/23.0/no-multilib/hardened/selinux (stable)
  [14]  default/linux/amd64/23.0/no-multilib/hardened/selinux/systemd (stable)
  [15]  default/linux/amd64/23.0/no-multilib/prefix (exp)
  [16]  default/linux/amd64/23.0/no-multilib/prefix/kernel-2.6.32+ (exp)
  [17]  default/linux/amd64/23.0/no-multilib/prefix/kernel-2.6.16+ (exp)
  [18]  default/linux/amd64/23.0/no-multilib/prefix/kernel-3.2+ (exp)
  [19]  default/linux/amd64/23.0/llvm (exp)
  [20]  default/linux/amd64/23.0/llvm/systemd (exp)
  [21]  default/linux/amd64/23.0/hardened (stable)
  [22]  default/linux/amd64/23.0/hardened/systemd (stable)
  [23]  default/linux/amd64/23.0/hardened/selinux (stable)
  [24]  default/linux/amd64/23.0/hardened/selinux/systemd (stable)
  [25]  default/linux/amd64/23.0/split-usr (stable)
  [26]  default/linux/amd64/23.0/split-usr/desktop (stable)
  [27]  default/linux/amd64/23.0/split-usr/desktop/gnome (stable)
  [28]  default/linux/amd64/23.0/split-usr/desktop/plasma (stable)
  [29]  default/linux/amd64/23.0/split-usr/no-multilib (stable)
  [30]  default/linux/amd64/23.0/split-usr/no-multilib/selinux (stable)
  [31]  default/linux/amd64/23.0/split-usr/no-multilib/hardened (stable)
  [32]  default/linux/amd64/23.0/split-usr/no-multilib/hardened/selinux (stable)
  [33]  default/linux/amd64/23.0/split-usr/no-multilib/prefix (exp)
  [34]  default/linux/amd64/23.0/split-usr/no-multilib/prefix/kernel-2.6.32+ (exp)
  [35]  default/linux/amd64/23.0/split-usr/no-multilib/prefix/kernel-2.6.16+ (exp)
  [36]  default/linux/amd64/23.0/split-usr/no-multilib/prefix/kernel-3.2+ (exp)
  [37]  default/linux/amd64/23.0/split-usr/llvm (exp)
  [38]  default/linux/amd64/23.0/split-usr/hardened (stable)
  [39]  default/linux/amd64/23.0/split-usr/hardened/selinux (stable)
  [40]  default/linux/amd64/23.0/x32 (dev)
  [41]  default/linux/amd64/23.0/x32/systemd (exp)
  [42]  default/linux/amd64/23.0/split-usr/x32 (exp)
  [43]  default/linux/amd64/23.0/musl (dev)
  [44]  default/linux/amd64/23.0/musl/llvm (exp)
  [45]  default/linux/amd64/23.0/musl/hardened (exp)
  [46]  default/linux/amd64/23.0/musl/hardened/selinux (exp)
  [47]  default/linux/amd64/23.0/split-usr/musl (dev)
  [48]  default/linux/amd64/23.0/split-usr/musl/llvm (exp)
  [49]  default/linux/amd64/23.0/split-usr/musl/hardened (exp)
  [50]  default/linux/amd64/23.0/split-usr/musl/hardened/selinux (exp)

Once completed with the stage file, the user is expected to install the base system, which includes copying the DNS info to the /mnt/gentoo/etc/ directory, mounting the necessary filesystems, entering the new environment, preparing the bootloader and configuring portage.

In the next part of the installation, the user will have to install the kernel, optionally they can download the linux firmware package. On many systems, non-FOSS firmware is required for certain hardware to function. The sys-kernel/linux-firmware package contains firmware for many, but not all, devices. The kernel, can be either compiled from source or installed as a binary.

Afterwards the user will now configure the system itself; fstab, hostname, root password.

Lastly, the user will now configure the bootloader, by default Gentoo recommends GRUB, but other bootloaders may be used. The user will now create their respective user account and reboot the system, where they will then be greeted by the Gentoo TTY. The user will now choose between a Desktop Environment or a Window Manager.

For detailed installation instructions, refer to the Gentoo Handbook.

Package Management

Portage

Portage is Gentoo's package management system, providing powerful features for system administration:

Key Components

  • emerge: Primary command-line interface
  • make.conf: Central configuration file for compilation options
  • USE flags: Package feature selectors
  • CFLAGS: Compiler optimization settings
  • package.mask/unmask: Version control mechanisms
  • package.use: USE flags control mechanism for individual packages

Common Usage

Command Description
emerge --sync Update package repository
emerge -uDN @world Update system
emerge -s package Search for packages
emerge package Install a package
emerge -C package Remove a package
emerge -pv package Preview package installation
emerge -c Remove orphaned packages
emerge --unmerge package Remove a package and its dependencies
emerge --depclean Remove unused dependencies

System Optimization

Compilation Flags

Gentoo users can optimize their system through CPU-specific optimizations, in order to compile packages specific to their CPU specifications and hardware. USE flags combinations can also be used for removing or adding any type of support to the desired packages, but the kernel must be configured manually for more customization. One can also set package-specific USE flags thru package.use inside their /etc/portage/ directory. The user must read the Gentoo Wiki carefully to fully understand these topics, as they can be quite challenging to comprehend as a new Gentoo user.

Binary Packages

For users seeking faster installation times, Gentoo offers pre-compiled package options, which usually end in -bin,

by example one might want to install Firefox without the hassle of compiling, they can just download the binary version of it by doing sudo emerge firefox-bin. Obviously, not all binary packages will end in the -bin format, they can be named simply like normal packages, for that reason Portage highlights the binary and source packages differently in colors so the user knows which are binary and which are meant for compiling, additionally portage also informs the user of which packages are binaries or source.

For additional packages, users might opt for the GURU project repository, it aims to be a very large user repository, full of binaries and source packages that are not found inside the normal Gentoo repositories, meant to extend the experience that you can have in this Operating System.

Users can create their own repository online as well, or how we call it, "overlays". The user can create an overlay with the desired package, make an ebuild for it and then publish it online for people to use. To get started with an overlay, one must first understand what are ebuilds and how they work, for this it's preferred to read the Gentoo Wiki on how to do it, it is possible to even add your custom package inside GURU later, and even the official Gentoo repository if it's seen as valuable.

Security

Gentoo allows users to setup extensive SELinux support, alongside hardened profiles. Gentoo receives regular security patches, and their bug tracker will always remain public so that everyone can see each issue Gentoo has live. The people behind Gentoo clearly mentioned they will not hide anything from it's userbase, as it destroys the trust between developers and users. Gentoo also has signed package verification to make sure each package remains unaffected by malicious individuals. Additionally, one can opt for the kernel hardening options that the developers rolled out for the community.

Community and Development

Community Resources

One might be interested in community resources for Gentoo. The official community forums can be found at forums.gentoo.org/.

Additionally, IRC (Internet Relay Chat) channels has been setup as well. For those who are interested in the official IRC channels, they can be found on the Gentoo Wiki in the IRC article.

It is possible to subscribe to the mailing lists or even send emails to them, the page lists the most important lists with the most traffic. There are other, more specialized lists that might be more appropriate depending on the topic.

There is a wiki documentation available as well. Users can search up specific pages in the site directly, so that they don't waste time finding the right page.

Ultimately, Gentoo offers a bug tracking system for those who are interested in being up to date with current bugs, or even attempt to solve them.

Development Model

Gentoo was developed as an open source project, with contributions coming from both the official developers and community members. Today, Gentoo is one of the most documented distributions to ever exists, with a very complex wiki and a lot of contributions coming in daily.

Everything in this distribution is almost fully community driven; package maintenance, bugs, issues, patches, or active ebuilds through public user overlays or the official Gentoo repository.

Security updates come regularly from the official developers, to maintain best security practices for the Operating System. The system encourages keeping packages up to date through it's rolling release model, while remaining stable. The behind the scenes of the entire Operating System is coordinated by an active team of developers, with direct communications to the userbase through it's IRC channels, mailing list and the Bugzilla.

Gentoo's source code alongside package data are publicly hosted in Git repositories, allowing anyone to view, fork, or contribute changes.

Comparison with Other Distributions

Gentoo allows maximum customization potential, optimal performance through compilation, complete control over features, extensive documentation, active community support and ability to fetch binaries in heavier packages. However, Gentoo has it's own downsides;

It will take longer to install packages as they compile from source, meaning it will take some time until finished and ready to use. If the system has a very weak CPU, the Operating System will take a while to fully install.

The Operating System has a higher learning curve, though one can learn how the system functions very quickly, one might prefer a more out-of-the-box experience rather than a Do-It-Yourself distribution.

Since Gentoo is a Do-It-Yourself distribution, one will require more technical knowledge than the average user. Regular maintenance is not much needed, but recommended.

Trivia

  • Larry the Cow is Gentoo's unofficial mascot
  • The name "Gentoo" (Pygoscelis papua) comes from the fast-swimming Gentoo penguin, a species that can reach speeds of 36km/h (22 mph), being the fastest of all species of penguins
  • You can view Larry the Cow by running emerge --moo

See Also

External Resources