Tyler Perkins

Junior Software Engineer - KE8TIZ

Gentoo

Tyler - 2021-07-04 14:09:26

Views - 98

Tyler Perkins - Gentoo

Gentoo is a great linux distro. I'd argue the best distro for an enthusiast/programmer. For those out of the loop, gentoo is a gnu/linux distrobution that compiles packages from source. All packages are managed with portage by default, and packages are first downloaded and compiled, using specific compiler flags for your system. The biggest advantage gentoo provides is the use of:

march="native" -O3

that line above basically makes the case for gentoo. Allowing the user to choose the optimization level used on their system, and compiling for their specific processor and all of the optimizations it provides, is simply unmatched.

Gentoo also lets the user use certain "use flags". A use flag is simply a common key word like "X", "GNOME", or "SSL". Different packages may have different options that can be enabled at compile time, and gentoo lets the user choose what components of a piece of software they would like included when building any package. If you don't plan on using KDE for example, but want to use gnome, you can just use:

USE="KDE -GNOME"

And just like that, you won't compile GNOME support into any of your packages. Now you save on disk space and resources that would have gone to GNOME support. Just like that your system is a little leaner and runs a little faster. Although on modern hardware it may not seem like a huge improvement, you'll be amazed just how much faster your system will wind up running.

Due to Gentoo's lack of any enviroment beyond a bash tty with the base installation, the user is also afforded a HUGE variety of choices when setting up their working enviroment. Just want something that works? Install GNOME/KDE/XFCE and get to work. Comes with a window manager, file manager, system utilities such as a settings program, graphical monitor configuration, etc. This would be the best option for someone coming from MAC/Windows as well.

If you're the more adventurous type, however, you can make your own working enviroment from different pieces of software, or even write your own! Programs such as i3/dwm/awesomewm are great to get you going, providing a way to display and manage windows, with nothing extra. Dwm lets you add features by modifying its source code and compiling it, or using premade patches and applying them to add features that you would like. Its similar to the use flag system, but by hand instead of being managed by portage.

Once you have a window manager you can start adding software like web browsers, file managers, media players, text editors, and terminal emulators. You can build your own enviroment tailored to your work flow, to make the most comfy system possible.

Gentoo also has the advnatage of running on literally anything. Like whatever you can think of. Chances are you can run it on that SOC in your fridge right now. Due to its nature of being compiled, all you need is a working gentoo system, and to setup a cross compiler toolchain. Once you have that you just build a bootable gentoo image, flash it to the device of choice, and it should be able to compile everything it needs to keep updating forever. Raspberry pi's, decade old laptops, your phone (in the works :D), that obscure little MIPS machine you have, anything. Gentoo is the distro to bring any device back to life!

Gentoo also happens to be what Chrome OS is based on, as well as being used for High Frequency Trading!

The Gentoo Logo
This server is (sadly) not powered by gentoo, but my laptop and soon my phone will be!

Common concerns

Compile times

If you've been programming for a while, or are familiar with how the build process works, you may be thinking "what about compile times?". Thats a valid worry, considering the time complexity of a compiler tends to be O(n^2). Despite this, I find that this only effects the intial setup. Because Gentoo has no installer, and you have to build up the system yourself from a live enviroment, this can be quite a headache if you mess up when installing and have to restart the installation process. But on my i7-9750H with 16GBs of ram, in total building the base system (no X11, firefox, window manager, etc), only took about half an hour. Thats enough time to read through some documentation on whats coming up in the installation, research kernel compiler options, or make some good coffee.

Stability

You may be worried about having your system break every week and having to waste time fixing it, however I've had no crashes/breaks that were the fault of the system. Only issues of me being negligent and not configuring things properly. I know that "works on my machine" isn't an argument, however if you know how to read man pages, read log files, and understand some jargon, you can setup a very stable system within only a few days. I know thats not an answer for everyone, but Gentoo doesn't want to be a system for everyone. It wants to be a system for those who are willing to put in the time and effort to learn how to leverage its customization.

Time sink

Some worry that its just a pain having to put in so much time to troubleshoot the system, to get it working with every piece of hardware on your machine, get a working kernel, setup a DE, wait to compile, its just all to much of a time sink. Some people just want to get started working on their codebase, using a browser, playing their games, etc. I really don't have much a counter to this. That is the reality of gentoo, and honestly its not a bad thing. If you want to put in the time, you will be rewarded. If you want to have something that "just works", then you will get something that is not as customized and optimized as you may like. And thats ok, some people want to make that sacrifice, I just happen to be someone who sees that time as worthwhile.

How do I get started?

You can get started with:

Thats about all I have, I plan on putting up more gentoo related info over time. I hope I've convinced you to try the best GNU/Linux distro!