LFS takes the wrong approach in my opinion. I did it once manually over a couple of days. I suppose I hoped enduring the pain of waiting for the packages to compile would somehow make me smarter. It didnât. I didnât learn much. It was like following a baking recipe. I know I need to add eggs and sugar in the ratio it says but Iâd be damned if I could tell you why that specific ratio works.
Itâs just too much to take in at once. You start by building a cross compilation toolchain but⌠why? And you add the bootloader dead last, even though itâs the first thing you see when you boot a Linux machine?
I reckon a better approach would be to build it step by step, only adding new things once youâve discovered a need for them. First you get the bootloader working, then you get it to actually load the initramfs and kernel, etc⌠you could even create your own extremely simple initramfs first before adding dracut, etcâŚ
This gets you to a system you can boot and play with asap. And then you can slowly start to discover why you actually need all these things through exploration and experimentation.
LFS helped me a lot. It taught me how to compile packages manually, and how GNU/Linux components fit together.
Armed with that knowledge, I could do things others could not do:
- Make applications that bundle/automatically download their dependencies, compile them with custom flags (static linking)
- Diagnose build errors buried in deep dependencies when using vcpkg
- Compile programs for esotheric systems: e.g: Intel MacOS X 10.5, an obsolete system noone else on earth is using except the company I worked at
- Create application targetting obsolete systems but using the latest version of its dependencies
- Compile recent programs on esotheric systems, by bootstraping a newer gcc on the newer system, patching as necessary
- Create my own stripped down distro, tuned to my specifications
- Use that stripped distro as a docker container
- Run recent linux on obsolete hardware no longer supported by mainstream distros
- Reformat a cloud dedicated server without physical access by first bootstraping a minimal distro on a ramdisk, unmounting the main drive, partitioning that drive, and installing the new distro on that drive. Reboot and pray.
- Build a cross-compiler for targetting a freestanding environment
- Build latest KDE/XFCE for debian stable. No more "but debian ships with outdated software!!11"
- Build applications on a distro they were not designed for (Zimbra OSE on debian)
This should be said more often, and in many other contexts as well.
Most educational resources are what- and how-based, only the best ones are primarily why-based, what Wirth once wrote in the preface to some Pascal book (I paraphrase) 'discussions are motivated, so that the learner gets coverage and understanding, instead of memorization'.
> And you add the bootloader dead last, even though itâs the first thing you see when you boot a Linux machine?
That actually makes perfect sense. If you did the bootloader first, how are you going to build it? How do you know what to boot from which filesystem on what device? By the time you've got your root filesystem complete, it's easy to tell.
If you do things step by step incrementally, you keep having to go further back in the process. Starting over repeatedly gets tedious, boring and frustrating. And it'll take ages to finish the complete OS.
I've learned the most from LFS long time ago, when I had no internet. I had a mismatching set of Slackware and redhat source CDs, and LFS itself didn't match the versions on CDs too. Since then I can build anything and anywhere, even if it's not cooperating :)
As pointed out already, LFS is a cookbook, and you learn most by having an idea about how you want to tune your Linux system.
So at points you want to dive deeper, you do â and go off the beaten path.
It requires a desire not just to understand how bits and pieces fit together, but how you can make them work even better for yourself and what is and is not customizable?
Arguably, even if building it today is easier â back when I did it in 2000, you sometimes struggled to find where the canonical source code of the package is, not to mention compilation errors, linking errors, etc. Only then did you get to configuring the init RC system, choosing between them (no systemd yet), etc.
But a requirement is â IMO â that you are strongly opinionated about how a system should serve you, and look for opportunities to tune it.
I learned a lot doing Gentoo stage 1. I was also following the guide like a recipe, but at the time I hadn't been exposed to the underlying machinery that is often automated, abstracted away, or done for me already. It was also a good test on how well I could follow instructions and later on apply my own customisations. Like lego.
I second this a thousand million times. But with AI, i can't help but admit i find myself indulging in building things backwards, now that i can try a couple different approaches simultaneously for it.
I used CLFS (Cross-Linux From Scratch) once to bootstrap Linux on my SGI Indy, and I learned quite a lot from this. That was back in 2008 or so, so way before AI and extensive online guides for almost everything. It taught me how cross compilers work, what dependencies exist in the GNU toolchain, how the SGI boots, and much more.
Too bad Cross-LFS is no longer a thing. Then again, with all these microcontrollers and ARM and RISC-V systems today, cross-compiling is no longer as magic (and tricky) as it was back then...
Compiling the packages doesnât teach much itâs all the glue in between. No? Itâs the startup scripts and the configs and creating a kernel and all the things.
Itâs on my list of things to do when I have some free time
You know, you could also just read about each step to learn more. I mean if you feel you're following a baking recipe, you can just... read about it more. And then have LFS as a simple way to experiment if you want to change anything or not. Also, technically you don't need to have a bootloader installed on your main hard drive if you already have it on another disk.
I mean, eh... last time I checked, this was Hacker news. Yesterday, there was an Ask HN topic on how to enable dark mode on HN. Is this the new hacker culture? Complaining that the resources merely point in some direction instead of specifying details?
My journey was: Start off by clicking LFS among the links, and then "Read online" in the sidebar, and then being lost. I see a header, "Current Stable" but I can't see the link to the actual book. I only see the errata, the security advisory and a link labelled... stable LFS systemd? Maybe it's that one? Yes, yes it is.
Took me half a second to realize I would probably start with "LFS :: Linux From Scratch is the main book, the base from which all other projects are derived."
For a long time (probably 2002-2010) I really wanted to do LFS. But I've been on Gentoo since 2004 which, over the last ~22 years, has probably exposed me to almost everything LFS would have, plus a lot more it wouldn't have. I still wish I'd did it way back when. I probably would stumbled through fewer issues had I.
I had the same experience. I think the only thing that LFS would add to that experience would be the package-manager-less experience (building without portage's help)
I did LFS once, a long long time ago (days of RedHat 7.3, I'd say, 2002), and it was quite educational! It's a good way to learn the fundamentals of what comprises an actual Linux system
This whole project wastes time that could be spent learning operating system design and it spends it telling users to download files and run ./configure; make; make install 100 times.
LFS is really, really bad. Also, reading the Linux kernel documentation to understand how to do it right is infuriating because it too is really, really bad.
LFS takes the wrong approach in my opinion. I did it once manually over a couple of days. I suppose I hoped enduring the pain of waiting for the packages to compile would somehow make me smarter. It didnât. I didnât learn much. It was like following a baking recipe. I know I need to add eggs and sugar in the ratio it says but Iâd be damned if I could tell you why that specific ratio works.
Itâs just too much to take in at once. You start by building a cross compilation toolchain but⌠why? And you add the bootloader dead last, even though itâs the first thing you see when you boot a Linux machine?
I reckon a better approach would be to build it step by step, only adding new things once youâve discovered a need for them. First you get the bootloader working, then you get it to actually load the initramfs and kernel, etc⌠you could even create your own extremely simple initramfs first before adding dracut, etcâŚ
This gets you to a system you can boot and play with asap. And then you can slowly start to discover why you actually need all these things through exploration and experimentation.
I'd like to counter your comment.
LFS helped me a lot. It taught me how to compile packages manually, and how GNU/Linux components fit together.
Armed with that knowledge, I could do things others could not do:
- Make applications that bundle/automatically download their dependencies, compile them with custom flags (static linking)
- Diagnose build errors buried in deep dependencies when using vcpkg
- Compile programs for esotheric systems: e.g: Intel MacOS X 10.5, an obsolete system noone else on earth is using except the company I worked at
- Create application targetting obsolete systems but using the latest version of its dependencies
- Compile recent programs on esotheric systems, by bootstraping a newer gcc on the newer system, patching as necessary
- Create my own stripped down distro, tuned to my specifications
- Use that stripped distro as a docker container
- Run recent linux on obsolete hardware no longer supported by mainstream distros
- Reformat a cloud dedicated server without physical access by first bootstraping a minimal distro on a ramdisk, unmounting the main drive, partitioning that drive, and installing the new distro on that drive. Reboot and pray.
- Build a cross-compiler for targetting a freestanding environment
- Build latest KDE/XFCE for debian stable. No more "but debian ships with outdated software!!11"
- Build applications on a distro they were not designed for (Zimbra OSE on debian)
This should be said more often, and in many other contexts as well.
Most educational resources are what- and how-based, only the best ones are primarily why-based, what Wirth once wrote in the preface to some Pascal book (I paraphrase) 'discussions are motivated, so that the learner gets coverage and understanding, instead of memorization'.
> And you add the bootloader dead last, even though itâs the first thing you see when you boot a Linux machine?
That actually makes perfect sense. If you did the bootloader first, how are you going to build it? How do you know what to boot from which filesystem on what device? By the time you've got your root filesystem complete, it's easy to tell.
If you do things step by step incrementally, you keep having to go further back in the process. Starting over repeatedly gets tedious, boring and frustrating. And it'll take ages to finish the complete OS.
I've learned the most from LFS long time ago, when I had no internet. I had a mismatching set of Slackware and redhat source CDs, and LFS itself didn't match the versions on CDs too. Since then I can build anything and anywhere, even if it's not cooperating :)
As pointed out already, LFS is a cookbook, and you learn most by having an idea about how you want to tune your Linux system.
So at points you want to dive deeper, you do â and go off the beaten path.
It requires a desire not just to understand how bits and pieces fit together, but how you can make them work even better for yourself and what is and is not customizable?
Arguably, even if building it today is easier â back when I did it in 2000, you sometimes struggled to find where the canonical source code of the package is, not to mention compilation errors, linking errors, etc. Only then did you get to configuring the init RC system, choosing between them (no systemd yet), etc.
But a requirement is â IMO â that you are strongly opinionated about how a system should serve you, and look for opportunities to tune it.
LFS is known but it is really more a cookbook than explanatory principles.
Principles can be studied from âOperating Systems: Three Easy Piecesâ book - https://pages.cs.wisc.edu/~remzi/OSTEP/
Rob Love wrote the book âLinux Kernel Developmentâ. https://rlove.org/
And then continue with reading LFS.
Setting up Oasis <https://github.com/oasislinux/oasis> taught me more than LFS personally. Everything being statically compiled makes it less magic.
I learned a lot doing Gentoo stage 1. I was also following the guide like a recipe, but at the time I hadn't been exposed to the underlying machinery that is often automated, abstracted away, or done for me already. It was also a good test on how well I could follow instructions and later on apply my own customisations. Like lego.
I liked KISS for this
It was like automated LFS from git
FreeBSDâs Makefile system is also in this ballpark
I second this a thousand million times. But with AI, i can't help but admit i find myself indulging in building things backwards, now that i can try a couple different approaches simultaneously for it.
I used CLFS (Cross-Linux From Scratch) once to bootstrap Linux on my SGI Indy, and I learned quite a lot from this. That was back in 2008 or so, so way before AI and extensive online guides for almost everything. It taught me how cross compilers work, what dependencies exist in the GNU toolchain, how the SGI boots, and much more.
Too bad Cross-LFS is no longer a thing. Then again, with all these microcontrollers and ARM and RISC-V systems today, cross-compiling is no longer as magic (and tricky) as it was back then...
> LFS takes the wrong approach in my opinion.
Shameless plug: I started a series of blog posts exactly because this. https://serversfor.dev/linux-inside-out/
Unfortunately due to some cervical spine issues and a surgery I wasn't able to finish it, but I am planning to pick it up and continue.
Thanks for posting this, I hope you will continue
Compiling the packages doesnât teach much itâs all the glue in between. No? Itâs the startup scripts and the configs and creating a kernel and all the things.
Itâs on my list of things to do when I have some free time
You know, you could also just read about each step to learn more. I mean if you feel you're following a baking recipe, you can just... read about it more. And then have LFS as a simple way to experiment if you want to change anything or not. Also, technically you don't need to have a bootloader installed on your main hard drive if you already have it on another disk.
I mean, eh... last time I checked, this was Hacker news. Yesterday, there was an Ask HN topic on how to enable dark mode on HN. Is this the new hacker culture? Complaining that the resources merely point in some direction instead of specifying details?
You can tell it's written by real Linux users because the landing page UX doesn't make it immediately obvious where to even start reading.
It is indeed glorious.
My journey was: Start off by clicking LFS among the links, and then "Read online" in the sidebar, and then being lost. I see a header, "Current Stable" but I can't see the link to the actual book. I only see the errata, the security advisory and a link labelled... stable LFS systemd? Maybe it's that one? Yes, yes it is.
it's like their brain is unaware of the concept of a timeline
... At the top? You're expected to read all of it! :)
Took me half a second to realize I would probably start with "LFS :: Linux From Scratch is the main book, the base from which all other projects are derived."
You mean the link to a page which _also_ doesn't have the main book?
From the news page:
> Bruce Dubbs - 2026/09/01
> The Linux From Scratch community announces the release of LFS Version 13.1.
For a long time (probably 2002-2010) I really wanted to do LFS. But I've been on Gentoo since 2004 which, over the last ~22 years, has probably exposed me to almost everything LFS would have, plus a lot more it wouldn't have. I still wish I'd did it way back when. I probably would stumbled through fewer issues had I.
I had the same experience. I think the only thing that LFS would add to that experience would be the package-manager-less experience (building without portage's help)
What's the news? This manual has been with us since forever.
https://news.ycombinator.com/item?id=49708089
I'm glad to see its still being maintained after more than 25 years since I last used it.
The best way to learn linux !
The last release of the no longer maintained sysvinit version is here (the default is systemd now) https://www.linuxfromscratch.org/lfs/downloads/12.4/
We did that, but in containers. https://stagex.tools/
List of (not all Linux) distributions that can be bootstrapped from source:
https://github.com/vasi/bootstrappable-distros
Related. Others?
Linux from Scratch - https://news.ycombinator.com/item?id=46709727 - Jan 2026 (103 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=41747966 - Oct 2024 (159 comments)
Beyond Linux from Scratch - https://news.ycombinator.com/item?id=39547118 - Feb 2024 (17 comments)
Linux from Scratch Version 12.0 - https://news.ycombinator.com/item?id=37648808 - Sept 2023 (28 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=33734685 - Nov 2022 (9 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=30496018 - Feb 2022 (96 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=29949311 - Jan 2022 (9 comments)
Linux from Scratch with Training Wheels - https://news.ycombinator.com/item?id=28820602 - Oct 2021 (41 comments)
Linux from Scratch 10.0 - https://news.ycombinator.com/item?id=24350738 - Sept 2020 (49 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=24238015 - Aug 2020 (86 comments)
Major Proposed Changes to Linux From Scratch - https://news.ycombinator.com/item?id=23787526 - July 2020 (93 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=20168343 - June 2019 (15 comments)
Ask HN: Is the Linux From Scratch project still relevant? - https://news.ycombinator.com/item?id=20149111 - June 2019 (7 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=16823110 - April 2018 (1 comment)
Linux from Scratch Version 8.2 released - https://news.ycombinator.com/item?id=16510333 - March 2018 (2 comments)
Linux from Scratch â build your own Linux distro - https://news.ycombinator.com/item?id=11829373 - June 2016 (57 comments)
Linux from Scratch - https://news.ycombinator.com/item?id=8392057 - Sept 2014 (1 comment)
Welcome to Linux From Scratch - https://news.ycombinator.com/item?id=4488162 - Sept 2012 (71 comments)
Linux From Scratch 7.1 Published - 3.2.6 Kernel + GCC 4.6.2 - https://news.ycombinator.com/item?id=3677350 - March 2012 (13 comments)
Linux From Scratch 7 Released - https://news.ycombinator.com/item?id=3171448 - Oct 2011 (27 comments)
Ask HN: Linux from Scratch.. Should I try it? - https://news.ycombinator.com/item?id=1779665 - Oct 2010 (58 comments)
How to build custom Linux from source code - https://news.ycombinator.com/item?id=743843 - Aug 2009 (1 comment)
The fastest way to learn and remember what Linux is about
I did LFS once, a long long time ago (days of RedHat 7.3, I'd say, 2002), and it was quite educational! It's a good way to learn the fundamentals of what comprises an actual Linux system
This whole project wastes time that could be spent learning operating system design and it spends it telling users to download files and run ./configure; make; make install 100 times.
LFS is really, really bad. Also, reading the Linux kernel documentation to understand how to do it right is infuriating because it too is really, really bad.