From Arch Linux to Gentoo Linux

Tags: linux

Create: 2024-01-14, Update: 2024-01-14

In the past few days, I hop from Arch Linux to Gentoo Linux.

What is Gentoo

Gentoo has long been a meme in the Linux community. It is not a beginner friendly distro, because it has a lot of configurations. The thing that makes it notoriously famous is the compilation time. Since Gentoo is a source based distro, everything is compiled from source, from kernel to Firefox. (Although there are some exceptions, like the proprietary Nvidia drivier.)

If you have never heard of compilation, you probably do not want to use Gentoo.

By the end of 2023, Gentoo introduced binary. This is the straw that broke the camel's back. If Gentoo has binary, what is the point of using other distros?

Why Gentoo

I have been asking myself some questions before switching to Gentoo.

Does it make any differences as a user?

No, I have almost the same experience when using different Linux distros. I have used different Linux distros before, debian, arch, (only counting the base distros, derived distros like Pi OS does not count). As a user, it makes no differences. I use Emacs extensively and setup EXWM. I even think that running on macOS and Linux are similar in my work flow.

The only difference of using different distros is the package manager. Another pain is the init system.

A lot of people focus on rolling release or stable release. In my opinion, only rolling release makes sense. Why would I use outdated programs and wait for the release schedule of a distribution to update?

I fucking hate systemd. In my experience of installing different distros onto different machine, systemd has caused me the more pain and anything else. Missing dependencies, weird behaviours. I have failed to bootstrap Arch on multiple VPS just because of systemd alone.

My main workstation was running Artix Linux, aka the Arch Linux without systemd. I used OpenRC instead, it is reliable, no bullshit, never fail.

But outside of occasional updates and writing my own daemon scripts for personal service, different distros makes no difference.

Is Gentoo faster?

Yes, slightly. Since most of the things are compiled on your own machine, we can not only remove the unwanted part by useflags, reducing the size of the application binary and speeding up the performance, we can also use the notorious "-march=native" to tell the compiler to optimize for my own CPU.

Does it give a lot of performance boost? No, the application does open slightly faster and less lagging, but just marginally noticeable.

Does it takes a long time to setup Gentoo?

Yes, a lot longer than I expect. Not only do I have to wait for the compilation, there are a lot of new things to learn, like useflags, masks, kernel config.

But after the initial setup, using Gentoo is no difference.

Why I prefer Gentoo over Arch?

First is its init system. The default init system for Gentoo is OpenRC, although I can use OpenRC on Artix, but that feels like a second class citizen in the Arch world. Whenever a package that has a daemon, I would have to explict download the OpenRC scripts for it. It is tidious and error prone.

Apart from the init system, since Gentoo is source-based and Arch is binary-based, everything from Gentoo can be compiled from source, which is also the standard way. However, on Arch, not everything is binary. Occasionally there are some packages that I want to use is not in the Arch repo. The common practice is to look at the Arch User Repository (AUR) first, ususally most of the things you would ever need are there. Sometimes, the AUR offers a binary package, I am happy. But sometimes, the AUR just offers you a simple way to compile the package yourself.

In my experience, OpenRGB and some wine packages need to be compiled from source even on Arch. Also, I am compiling Emacs from source for the features I want. Actually, most of my time is spent on using Emacs, a software that I compile myself. Then what is the benefits of using Arch?

In Gentoo, I have a much nicer way to select the compilation options by the built-in useflags. I would not have to keep a version compile flags to configure every package that I want to compile myself.

Finally Gentoo

At the time I finally compiled everything and have a running Gentoo system. It feels like the end game of desktop Linux in my life. What else can be better that such a customized distro? Well, maybe Linux from Scratch, but I would expect that brings me more pain than joy.

Installing Gentoo is not as hard as I think, the Gentoo handbook is so well-written. I learnt a lot of things from it. However, I still do not recommend any newbie to use Gentoo. Using Gentoo assumes so many previous knowledge to have a fully usable system.

In my installation, I faced some weird bugs and googled a lot to desperately find a solution. But in the end of the day, no solution was found and I fixed them using my instinct.

Next time, I may write a blog about an installation guide of Gentoo.