cowmonk's random blogs

Beyond Prepackaged - Why I Use Linux From Scratch

Building Linux from Scratch can feel a bit like assembling a complex jigsaw puzzle: frustrating at times, but ultimately supremely rewarding when everything clicks into place.

Published by cowmonk on

Beyond Prepackaged - Why I Use Linux From Scratch

cowmonk

Linux From Scratch…

The very name tells you everything that you need to know.

Already, there is a sense of dread when you think about starting with a bare-metal system and building everything from the ground up. And it doesn’t get any better, one quick look, and you learn of the monstrous process of manually installing and resolving your own dependencies. Not only is installing is difficult, but updating it too. Looking at this, people will naturally wonder, “why would you even try using LFS?”.

I am not the average computer user, but I do still use an LFS system for school and other fun things no problem. What I say doesn’t mean that I’m telling you how you should use your computer, but an insight of why I personally enjoy it. If you are interested in what I talk about, and if you want to try LFS; I implore you to try it out or explore it, but be aware of the hardships you’ll face because, I do want to preface that LFS is no weekend project, unless it’s not your first rodeo and you’re following by the books, it’s a marathon, and your patience–or coffee supply–will be tested.

Building Things from Scratch

There is a common misconception that LFS is really difficult to maintain, and even sometimes I see people say practically impossible; however that can only be far from the truth, and the difficulty of it isn’t that high as well: the handbook can be easily skimmed and the process is relatively simple to understand. Most people can just copy & paste, just like most of troubleshooting in Arch anyways. However, there is a level of difficulty in the tedious task of installing packages without a package manager. But that also isn’t fully true in itself either, as you can install a package manager like nix (in my opinion, flatpak done right) to automate most installations. Obviously, you could use normal distros and also install nix on top of that, but the ability have multiple options like pacman, apt, zypper, xbps, etc. are all available on LFS, without the need to distro-hop, and without the need to isolate the package manager in its own prefix since it’s really not a good idea to not isolate it.

And that is where we go into one of my favorite aspects of LFS: the ability to build everything with your own tools and environment that you want: You are not bound to any environment. That probably means nothing to the majority of users, but the fact that you are not bound to anything is very liberating; what it means is the ability to be fluid–similar to how Arch Linux is not defined to what it looks like, while Ubuntu is generally thought of with their own Gnome spin–LFS is not defined on what it can even come with.

But of course, another thing people say is that Gentoo is just LFS with tools on top. This is not entirely true, Gentoo is a “meta-distro”, a fancy way of saying that although it is much more customizable than Arch, it is still a “distro” at the end of the day. There are tools that are forced upon you, such as portage, udev, etc. that make it give you the “gentoo experience”. A real LFS with tools would be starting from SCRATCH (no stage3s or whatever) and adding the tools you want yourself, which is what you do on LFS anyways. But then does it mean that you can’t enjoy the customizability Gentoo already gives you? Of course not!

But what I mean is that the customizability and control that you have over your LFS system is unlike any other distro I have ever used. There’s something satisfying that comes from understanding how all packages are compiled and how USE flags on Gentoo really works on a lower level. There is much less abstraction, and you get to take in the raw “Linux experience”. There is a sense of accomplishment from doing these types of challenges as well, so that’s another bonus too.

Challenges

Of course, the ease of LFS can only be true if you follow the handbook word by word and not shake things up a bit. Everything I said about LFS’ difficulty before is still true. But the real hell comes from lack of documentation; while the handbook is comprehensive, doing anything not in the handbook often require digging through forum threads and/or mailing lists. Whilst this is the norm for most programmers, at least with the rise of AI: finding answers to those programming questions are much easier and generally accurate. Unfortunately for me, doing crazy things like a pure clang toolchain on LFS is apparently not in any training data of any popular LLMs I’ve tried, resulting in just trial and error. And trust me, I’ve done all sorts of prompt engineering, but to no avail.

A common misconception that I want to address here is concerning the stability of LFS. And unlike Arch that’ll break if you breath on it the wrong way, LFS is surprisingly stable and nothing usually ever breaks, only very rarely. And it has to do with the fact that it’s not very common for most LFS users to update their packages and most LFS users following stable releases of the handbook that are known to work. At least from my experience, a LFS system has never broke on me but there are compilation issues if you try and do what I do: my own damn way. Other than those outliers, it’s similar to why debian is stable in that you rarely ever update; and when you do, it usually should work out fine since you usually only update one minor component of the system, like for example firefox rather than core components like glibc very often.

Challenges to using a LFS system are always annoying, they always happen due to my nature of tinkering too much, but at least for me: the challenge is always worth it. It makes using my computer more exciting, and the results of doing something that no one really does makes me feel great. Every time my computer boots, it’s a testament to perseverance and continuous learning, and somewhat of a surprise to the stability of a LFS system.

Final Thoughts

I have done my best to compile some of my favorite aspects of LFS into a coherent blog post, but in reality it’s a complicated love-hate relationship. I really think LFS is about breaking abstraction layers and discovering the beauty of simplicity beneath complex design. Before I have tried LFS, I never really understood how complex Linux was, how modern tools really made our ideas of distros so convoluted and we don’t really appreciate the effort and work that really goes into it; especially for me, as the founder of LearnixOS, it’s really thanks to LFS that I have a clear path and a vision to create an independent distro.

For all to have made it to the end of this blog post, I want to thank you personally for taking an interest into what I have to say. I want to apologize for the wait, I’ve been pretty caught up with school, and hopefully I can try to make these come out faster. I also want to thank Patrick from the LearnixTV server for this amazing idea, I hope I answered the question to a satisfactory amount.

But that’s all from me! Happy building, and may your compilations be error-free!

– cowmonk

Tags: misclinux.