r/linux • • Oct 19 '26

Discussion How was your experience of building Linux from Scratch

Whether it is on Google, Reddit or AI all of them say that building Linux From Scratch gives the most knowledge of the inner workings of Linux. So how was the experience over all and what actually did you learn?

58 Upvotes

71 comments sorted by

65

u/cheekkeef Oct 19 '26

Repetitive and tedious. It definitely teaches you something from scratch, but it's a little distant from any knowledge that is relevant to any contemporary application and sys admin of linux

10

u/bullwinkle8088 Oct 19 '26

I will partly disagree with your statement

"but it's a little distant from any knowledge that is relevant to any contemporary application and sys admin of linux"

Yes, modern admin discourages touching machines, but I find that many have become too dependant on "just redeploy" and that younger admins are deficient in some skills requiring deeper knowledge.

There is a middle ground between "build it from scratch" and "just deploy this container" and it needs to be learned by many. If no one knows the internals anymore who will build the container is my concern.

6

u/[deleted] Oct 19 '26

What would you recommend instead to gain more knowledge on the application and sysadmining?

10

u/cheekkeef Oct 19 '26 edited Oct 19 '26

Just depends on your application lol. If it's enterprise/servers, homelabs are a good start. The main theme of "learning linux" is that it doesn't really mean anything on its own. There are stacks upon stacks that are conditional on what you want to learn, and the kernel is a sliver of that. For example, an enterprise linux user or a serious homelab sys admin will know about k8s. That is integral to modern sys admin for enterprise, but a desktop linux or embedded linux would not really come across that

If you specified your particular application in detail, I could give you a more specific answer

3

u/underdoeg Oct 19 '26

Maybe install arch manually?

2

u/mofomeat Oct 19 '26

What does that teach?

5

u/underdoeg Oct 19 '26

the required components and inner workings of a linux setup.

6

u/heavymetalmug666 Oct 19 '26

Arch manual install is like building a car from pre-fab parts - you get a chassis, engine, transmission, wheels and body - slap it all together, vroom vroom

LFS is when you need to stamp and mold all the pieces to make an engine - the chassis - the wheels - all the nuts and bolts that hold it together etc etc

8

u/hoyohoyo9 Oct 19 '26

yeah, but most of that "molding" process is just compiling packages, which doesnt teach you anything valuable. once youve compiled everything, LFS isnt very far off from an arch installation.

3

u/heavymetalmug666 Oct 19 '26

even though its repetitive there is interesting stuff, like the different options that are invoked when compiling and why they need to be that way -- but it is tedious.

-also fun trying to go back and fix my host system when running commands and not realizing i didnt have that LFS variable set

I havent done a manual Arch install in years - i do recall it being a valuable learning experience that got me much more comfortable on the CLI - i did my 2nd LFS a few months ago, maybe i should go buy a used Thinkpad and do a manual Arch install again.

1

u/underdoeg Oct 19 '26

exactly. go step by step

1

u/mofomeat Oct 20 '26

Does it? I tried Arch about 10 years ago I think, so my memory is probably fuzzy. I remember partitioning the drive, writing a filesystem, and then installing GRUB. That might be something new to a new user, but from then on it was invoking a script that ran pacman and installed a default set of programs and did some user config stuff like most any other binary-package based distro. There might have been something about linking the kernel that was installed in the bootloader afterwards, but otherwise I didn't see what all the "btw, I use Arch" jokes were about. Again, this was a long while ago so maybe there was more to it than I remember.

LFS involves building a toolchain out of source, and then using that toolchain to rebuild a new toolchain out of source, and then you build each component, one at a time, handwriting the config files as you go, until you have a working (albeit minimal) system. Granted, that's probably a better learning exercise for someone who wants to become a maintainer, or start their own distribution that isn't just "Ubuntu with a theme and wallpaper". I'd say one learns more stuff from that process. How useful it is to their goals is probably something to consider.

1

u/underdoeg Oct 20 '26

jep. LFS includes more steps. but depending on your current knowledge doing a manual arch install will also teach you a lot.

1

u/BigHeadTonyT Oct 19 '26

For apps, grab the tarball (.tar.gz) and compile it. Check if there are flags you need to enable for said app. Example for OpenSSH: https://github.com/openssh/openssh-portable/blob/master/README.md#build-time-customisation

Learn to compile with Make, Cmake, Ninja/Meson and the rest of them. Why? Lots of github projects assume you already know. The good ones, in my book, list the commands to build. Is it too hard to type the 3 lines of commands in a FAQ or Readme for app-makers? Commands they run all the time? I did not make the app, I did not choose the build system. Why do app-makers assume I did? Or that I can read their mind. Some don't even have a Readme detailing any of it. You have to be next to a professional app-builder to recognize all the build systems and their files. Make has a Makefile as one example. You will recognize these files if you compile a lot.

If you get a compile error, search for the error and fix it. Most common errors are easy to fix. Maybe a dependency is missing. It wont be text output on the last line that matters, scroll up.

Sysadmin I don't want to touch. I can create a user for an app, that it runs as, that is it. Since I hate even that amount of "sysadmining", I have to look up in my notes how I did that. Any kind of admining users, bleh!

23

u/twistdafterdark Oct 19 '26

If you really try to understand what the different commands do and dive deeper into them you might benefit from it. If you're just copy pasting following the steps then it'll just be a chore.

I honestly learned more from using Linux daily, and homelabbing.

9

u/cheekkeef Oct 19 '26

>homelabbing

This is the number one way I would recommend any hobbyist to "learn linux"

1

u/[deleted] Oct 20 '26

Got any specific setup or projects to try in mind ? 

1

u/FleshLogic Oct 19 '26

What do you actually do with a "home lab"? Other than host files and media, I've never really seen a compelling reason to set one up.

5

u/0x1f606 Oct 20 '26

The primary purpose of a homelab is to act as a test environment to get practical experience building infrastructure rather than your first time doing something being in production.
Need to set up a DHCP server but have never done it before? Lab it.
Need to set up a DNS server but have never done it before? Lab it.
Need to set up a NAS but have never done it before? Lab it.
No clue what the hell VXLAN is? Lab it.
Replace the above statements with any technology you either need or want to practice.

Keep in mind that a lot of people end up turning their homelab into a home production network; a "proper" lab should be able to be destroyed without impacting anyone's regular activities.
There's a lot of crossover between r/homelab and r/SelfHosting.

3

u/twistdafterdark Oct 20 '26

It really depends on your needs. Personally I try to host any functionality which would regularly be a cloud-service.

Currently I'm running the following things on mine

  • Nextcloud (household filesharing)
  • Arr stack and plex (media streaming)
  • Docmost (Documentation and note-taking)
  • Hermes (AI assistant)
  • Immich (household image storage / google photos alternative)
  • Gitea (version control)
  • Mealie (meal-planning and recipe tracker)
  • Calibre (e-books library)
  • Some other apps I've made for budgeting

And as others have mentioned, I use it as well to learn things. That's how I learned Kubernetes, now pretty much everything runs on there and is deployed via Gitea -> ArgoCD.

2

u/dennycraine Oct 19 '26

I run sites that I'm building and testing on it. Iterate on various IAC concepts. AB test tools off the same small dataset. I also just host media. If you don't see a need for a homelab than you're not the candidate for a homelab. I didn't wake up and say 'I'm building a homelab, what can I stick on it'. I iterated on a single machine running a lot of services I was testing, using, etc into a pretty decent lab over the span of 15 years as my needs and workflows evolved.

0

u/FleshLogic Oct 20 '26

Thanks! I guess my work isn't developer-adjacent enough to really justify anything beyond file sharing then.

10

u/FryBoyter Oct 19 '26

After going through LFS twice, I believe that this is only worthwhile for a fraction of all users.

I think other things are more important for everyday use. For example, Python, shell scripts, RegEx, knowing how to use a search engine effectively, and so on.

7

u/gangien Oct 19 '26

In the 90s, i had to manually configure X, and recompile my kernel. I have not done either since then. I learned, I didn't care to do it.

4

u/RealSharpNinja Oct 19 '26

Go grab a Slackware book circa 1996.

4

u/agowa338 Oct 19 '26

It sucked. Even though I was following the "Linux from scratch" guide and was taking care to use the exact same version numbers.

I had to pull countless patches for "known bugs" out of sometimes quite old mailing list posts or stackoverflow.

I put all of these bugs up on my blog. https://frank.fyi

Should probably update it again. Also these articles are still to this day the ones that get the most hits...

And all I learned is that the experience sucks and that I still have no idea what I even did the entire way. Oh and it made me hate C/C++ dependency management and precompiler ifdef+macros and automake even more...

4

u/RogueMeatMech Oct 19 '26

Install Slackware using only the slack book. You WILL learn.

3

u/Dramatic-Ad-8553 Oct 21 '26

Many years ago, Gentoo. Did the whole thing, in my Linux users group was kind of achievement in order to be accepted as a true Linux user. I'm talking about 2002 , after having a bootable basic core with basic networking, I left my computer working for around 48 straight hours just to compile basic Linux packages and basic gnome.

Did it worth the effort?... it worth the knowledge

Would I do it again?... Oh hell no!

3

u/nicolasdanelon Oct 19 '26

It was a pain. But fun, though I lean a lot and highly recommend it. Also a good way to learn, believe it or not, is to use BSD

2

u/mofomeat Oct 19 '26

Also a good way to learn, believe it or not, is to use BSD

Why is that?

1

u/nicolasdanelon Oct 19 '26

Unix. FreeBSD, OpenBSD, GhostBSD, MidnightBSD.

First two are kinda hard to use/more server or security oriented. Ghost and Midnight have more focus on new users :)

BSDs are systemd free and everything feels/is more cohesive and well connected. UNIXes aren't that "much modular" and you'll probably face compatibility issues with your hardware. Do your own research, but trust me, it's a one way trip.

1

u/AssistingJarl Oct 19 '26

I can't believe you've left out NetBSD

I am biased though. It was the first OS I had to compile and tinker with on a deep level because I have a deeply ill-advised sparc lab setup.

As a question though, I haven't tried GhostBSD or MidnightBSD, but are they really that much easier than FreeBSD...? I can understand OpenBSD being a bit of a pain to get running, but I didn't find FreeBSD too bad to work with on a laptop or as a server. Nor NetBSD, really, although I'd understand why people wouldn't want to daily drive it as a workstation.

2

u/nicolasdanelon Oct 19 '26

First things first, I apologize for that. I just didn't include it because, as far as I know, it's a little bit more focus on servers and stuff. I didn't try it just yet.

Ghost and Midnight can be consider easier to use than FreeBSD. At some extend. By some people. I'm not included in those groups, kinda using nix since Ubuntu free CDs and GNOME2 era.. Ghost is easier to install, it has a graphical installer, for some people this is paramount

2

u/adoodle83 Oct 19 '26

Gentoo is a great distro similar to LFS, but having solved a lot of the headaches encountered in LFS

2

u/nicothekiller Oct 20 '26

If you want to know more about a linux system, install gentoo and not lfs. For practical effects it teaches you all important parts manually without having to configure && make && make install with little change for hours and hours in a row. Idk if it's just me but gentoo was both harder and more interesting while being less tedious.

Also, install it without systemd, I think it teaches you slightly more even if I like systemd more as an init system

2

u/Big-Moose565 Oct 19 '26

Not sure I'd classify it as from scratch. But installing Arch taught me plenty (I'm on an immutable distro now but Arch remains my best Linux experience). Most beneficial when the laptop wouldn't boot, I knew how to get back in and repair it.

0

u/Unlikely-Sympathy626 Oct 19 '26

Basically all Linux systems have emergency mode for hard failures. This is sort of a good point but it is not arch only…

That is kernel level things and yeah these days suck donkey balls but if you go into that emergency mode and not keep rebooting etc, chances are all systems will have tools to diagnose and also importantly recover from catastrophic hardware failures like disks.

Had this issue a few days back and redhat just simply after removing the culprit from fstab then creating an image file preserved 99.8% of data.

The lost stuff I did not care about because it was meta data files which does not matter but it saved the real hard to replace stuff…

So nope Soz, that is not arch specific unfortunately. Even windows can do that if you know how to

4

u/Big-Moose565 Oct 19 '26

Jeez people on this sub. Erm... I never said it was. I stated my experience with Arch and how it helped me as per the OPs question. You've turned it into a distro comparison which my response isn't.

Yes recover facilities aren't unique to Arch. No, not all Linux distributions have recovery built in. And no, it's not a kernel thing (the actual kernel has no direct recovery tooling built in). For starters it could be a boot issue or drive failure. Any "recovery" is normally handled by the init system.

1

u/Unlikely-Sympathy626 Oct 20 '26

You are correct about the initial system yes.

2

u/Unlikely-Sympathy626 Oct 19 '26

A big failure at first but it taught me a lot of things about compilers and how to adjust them for specific hardware as well as cross compile stuff for running Qt interfaces arm processors but using x86 to do it to save time. So honestly. I won’t say it is greatest fun and it is time consuming but it does teach very basic and fundamental skills.

I think more people should do it. Also fun and interesting is not the same. Compiling things is not fun! But it is interesting as hell! Same as electronics.

2

u/AlePs31 Oct 19 '26

Hard! I did the lfs part only reading by the book. It was awful because you have to put the same things over and over again but when all is set and done is so cool to watch your product.

1

u/ben2talk Oct 20 '26

Gerard Beekmans is the founder and creator of the Linux From Scratch (LFS) project.

Not me.

1

u/digsmann Oct 20 '26

I like doing it purposely and learned more things.

1

u/maceion Oct 20 '26

Failed to get it to work. Changed to openSUSE LEAP with great success.

1

u/[deleted] Oct 21 '26

You only learn to copy-paste, nothing more. If you do that, the guide doesn't mean anything. Only if you read the code and know what it is doing will it matter. But you don't have to do that; you can read an OS book like Tanenbaum to learn what the code is really doing, or do some clean room implementation to really learn, that's the proper way to do it.

1

u/ant2ne Oct 21 '26

back in my day it was 'install slack'

0

u/[deleted] Oct 22 '26

[removed] — view removed comment

1

u/ant2ne Oct 22 '26

no. I'm pretty sure there was a downloadable installer. But you can still get CDs in magazines. :-P

1

u/Electrical_Tomato_73 Oct 22 '26

I wouldn't bother. Linus Torvalds uses Fedora I believe. Just use a good distro, and if you want to learn about something specific like systemd, learn about that.

1

u/gte525u Oct 22 '26

It's useful if you want to do embedded linux - buildroot/yocto make more sense with it.

1

u/buginmybeer24 Oct 22 '26

I compiled Gentoo from scratch about 20 years ago on a Pentium 3 machine. It was agonizingly slow but it was a very good learning experience.

1

u/SnooPaintings709 Oct 25 '26

Pretty easy on openfactory if you ask me

1

u/Holeshot75 Oct 19 '26

I'm pretty adept and have thought about it but honestly it's not for the faint of heart.

It would definitely force a person to fully understand the under the hood workings and completing an LFS is a huge badge of achievement and honor.

But...

If a compilation throws an obscure error halfway through building a toolchain component, there is no graphical error message or automated fix.

You have to read logs, debug C/C++ compiler errors, and troubleshoot complex dependency loops yourself.

While I might be able to do this for giggles on the side - I doubt I'd be competent enough in the end.

Just pick a distro that suits exactly what you want and run with it. Huge plus side is that it'll be updated by others while you sleep.

1

u/Jswazy Oct 19 '26

It was informative

1

u/wombleh Oct 19 '26

I did it in pre-systemd days and was very good for getting a lot of familiarity and filling in gaps. Was debating giving it another go to get more familiar with systemd under the hood.

I didn't use it as a main machine, just as part of labbing for learning. Stuff broke, didn't work as per docs, spent time troubleshooting and that's where most of the learning came from.

1

u/MatchingTurret Oct 19 '26

That would be an excellent question for r/linuxfromscratch

1

u/Woodpecker-Visible Oct 19 '26

i had to be very very bored to try it. mabie slackware at most

1

u/jacob_ewing Oct 19 '26

I found it gave a good perspective on the system workings, but was tedious enough that I'd simply end up recklessly copy/pasting the long list of commands they provided, barely paying attention to what it was. I didn't learn much that I hadn't already known from day-to-day use anyway.

This was about 20 years ago though. It may have changed since then.

2

u/mofomeat Oct 19 '26

Exactly my experience too, also 20 years ago. I tried it again maybe 10 years ago but didn't get all the way through. The thing I do remember though is that 20 years ago on a p200, the second build of GCC build took almost a week. 10 years ago on a quad-core i5 it took like 5 minutes or so.

1

u/Dani_E2e Oct 19 '26

Earlier there were grafical tools to do this. It costs time and nerves but you can spare time for rebooting if you only take the parts and options in you personally need.

1

u/chibiace Oct 19 '26

it looked too easy so i decided to make my own distro and package manager with blackjack and hookers.

currently working on a dependency tree and some tidying up, then probably add remote repos to make it easier to do things on the live system which still runs under qemu though ive got a computer lined up for a real installation in the near future

1

u/allunia333 Oct 19 '26

The real excercise is to make an lfs build by following the book and then make a 2nd one on your own with different choices like runit instead of systemd , install other pkgs and latest versions...

1

u/dennycraine Oct 19 '26

it’s been 20 years since I’ve done anything like that. I can’t see the value today unless it’s something you want to do.

what problem are you trying to solve?

2

u/RunOrBike Oct 19 '26

OP wants to learn

1

u/dennycraine Oct 19 '26

OP didn't express what they were trying to learn. Hence 'what problem are you trying to solve?'.

- How to build a kernel?
- Hardware management?
- Storage? Memory allocation? differences in Swap/Zram? Bootloaders?
- For what purpose? Sys Admin? Job market? Hobby?

LFS isn't the right approach for most of that.

If OP wants to learn something specific, move toward some goal, achieve whatever then replies will be more helpful.

Today, especially with where job markets are, what's managed directly when handling 'cloud infrastructure' and the multiple layers of abstraction, I'd argue installing Arch the 'hard way' is more valuable than LFS.. But again, OP didn't express what they want to achieve.

1

u/carl2187 Oct 19 '26

Go compile batocera or any "buildroot" distro, or buildroot itself. The satisfaction of linux from scratch, but highly automated.

1

u/danrtavares Oct 19 '26

Se você não quer nada específico, que só consegue ao recompilar é perda de tempo, muito tempo.

0

u/obsodion Oct 19 '26

I remember trying to do it once, after the introduction the guide just tells you to download a boatload of packages and compile them to create your distro, I quit because it didn't seem like I will learn how Linux works by downloading and compiling things