Making your Arch to Gentoo switch painless.
Tags: linux, opensource, archlinux
Published: 2021-03-12 09:17:56

After using Linux as my primary O.S. for many years now, I will try pouring my experience in this to exhibit what I learnt from it with few advises and some tips and tricks which I found to make it a further better experience.

<h1>About this article.</h1>
This article isn't gonna be about how to install Gentoo as the <a href="https://wiki.gentoo.org/wiki/Handbook:AMD64">documentation</a> and forum is marvelous and isn't any less than arch, but rather about how to enhance the installation process and usage afterwards for desktops.

<h1>But why to switch?</h1>
<ul>
<li>As Arch uses binary packages, it means that the packages are compiled for supporting vast range of hardware and isn't actually optimized specifically for best performance and efficiency on your machine.</li>
<li>There are many compile time options or flags for features and optimizations of the packages which are decided or configured by the distribution (mostly enabling everything to support all use cases possible making packages bigger unnecessarily). This can also affect performance, usage and even security.</li>
<li>It uses systemd which is quite heavy on it's own.
<li>So in short, if you compare Arch with something like Ubuntu and feel that it's far superior, the only real advantage you get over it are the few gigabytes of disk space, that's it!</li>
</ul>

<h1>Then how's Gentoo better?</h1>
<ul>
<li>Gentoo's portage with it's make config and USE flags is really very powerful, it gives the control back in your hands while being simple.</li>
<li>You may think that it must take too long to compile packages but in reality, many packages get compiled in just a few minutes.</li>
<li>The installation process seems quite difficult, but when you go for it, it isn't that different than arch and the Gentoo documentation gets you covered fantastically.</li>
<li>It can be more secure as it's possible to restrict functions and access on package level.</li>
<li>As it is source based, you can make it optimized for your hardware and make it really slim and efficient.</li>
<li>It uses openrc as it's init system.</li>
<li>Gentoo encourages to configure and compile your own kernel which has it's own set of perks.</li>
</ul>

<h1>Installation tips.</h1>
During installation, some packages like toolchains and compilers can take few hours to get installed, but an easy solution for it is to install binaries of those packages, mainly rust and gcc. Some people may hate this but after you think about it rationally, there isn't really much you want to change in them, so it's better and quick this way. You can always change this later if you want.

For binary package of rust, there is already a dev-lang/rust-bin atom in gentoo repos but for binary package of gcc, I will recommend reading Gentoo's <a href="https://wiki.gentoo.org/wiki/Binary_package_guide">binary packages guide</a> and using something like `PORTAGE_BINHOST="http://packages.gentooexperimental.org/packages/amd64-stable"` in your make.conf.

Use <a href="https://wiki.gentoo.org/wiki/Ccache">ccache</a> for making compilation faster.

For managing USE flags, use a tool called <a href="https://wiki.gentoo.org/wiki/Ufed">ufed</a>.

The kernel configuration can be a real pain, especially for people who are new to it. It can be solved by using a prebuilt kernel binary or genkernel. <a href="https://wiki.gentoo.org/wiki/Genkernel">Genkernel</a> will be better as you will be compiling your kernel so you can <a href="https://www.youtube.com/watch?v=NVWVHiLx1sU&t=1646s">modify the kernel</a> later as you need it and it has a default generic config which should work on most hardware by using `--kernel-config=default` flag.

By this, you can get a Gentoo system running without much tinkering and then modify it later as you use it.

<h1>To further enhance the experience.</h1>
So lets be honest, few packages may take varying time to compile and if you are like me and use a laptop or rather in general, you may sometimes need to install packages on the fly or you may just miss (some stuff from) arch or you may have any other reason of your own.

Regardless, you can install Arch's pacman package manager in gentoo but I won't recommend it as it will get really complicated to manage your system, conflicts and package versions.

So, you can use something like <a href="https://github.com/fsquillace/junest">Junest</a>, which is like arch with chroot on steroids and more, it's just amazing how handy it is. It doesn't require su access and is isolated from your system in your home directory and is super easy to manage or just to remove it for any reason whatsoever.

<h1>Final thoughts.</h1>
This article was written with an intention of giving the last push to the people and to remove the common misconception that Gentoo is very difficult to install or use, whereas it's very simple and totally worth it.