Making a Linux Distro from scratch

rkt_lvr

New Member
Joined
Feb 26, 2026
Messages
2
Reaction score
1
Credits
18
Hi, I want to make my own linux distro from scratch. I want to make it without tools like busybox or slax. I have done lfs before but I have no idea where to start.
 


Hi, I want to make my own linux distro from scratch. I want to make it without tools like busybox or slax. I have done lfs before but I have no idea where to start.
If you have already "done lfs", that is, built a linux system from the instructive book at the Linux From Scratch (LFS) home site from here: https://www.linuxfromscratch.org/, then you may be aware of some of the issues that arise with such systems. A major one is the lack of a package management system. That means that the user is left to their own devices for upgrading the operating system. The issues here are the satisfying of dependencies which can become a nightmare commonly referred to as "dependency hell". As the updated software appears for programs issued upstream, one is best advised to upgrade their own systems to keep both functionality and security issues under control. If one doesn't attend to security issues in modern times, there can be unfortunate consequences best avoided. Package management systems solve this issue unavailable in both LFS and BLFS.

A couple of relatively sophisticated sources for development of operating systems are the web site: https://wiki.osdev.org/Expanded_Main_Page, and the book by Andrew Tanenbaum "Modern Operating Systems" which is available as a pdf online in a few places.

Opinions may vary, but the section on "Beginner Mistakes" at the osdev site is probably worth reading with close attention.
 
Last edited:
To create a Linux (distribution) From Scratch, you have to:
  1. Create new packaging and package distribution system, or pick an existing one.
  2. Then do Linux From Scratch until you have a neat running system, "golden master".
  3. Install the tools of #1 on your working LFS
  4. Start packaging what you have chosen as "the golden master" for other to reproduce with the system in #1.
  5. Get another machine and place it on your desk, and install your new distribution from scratch until it's usable.
  6. At this point you would have obtained the first machine running your new distribution, allowing you to leave LFS behind. You would have to duplicate this machine to obtain:
    1. A testing machine, to do user testing of your builds.
    2. A build machine 100% running your on distribution.
EASY!, what can go wrong.

For example, install LFS, install rpm-tools, and begin building RPM and dependency relationships.
 
I guess, also, that you can start from another distribution instead of LFS, but the problem is that your product would be biased / influenced by that initial choice.
 
Hey @osprey the post is 100% serious except for the "EASY! what can go wrong" part. If you don't build your own packages and pick someone else's (Debian's, Arch's),... you're not creating a new distribution, but a derivative one.
 
Package management systems solve this issue unavailable in both LFS and BLFS.

Absolutely!

As I recall, package management is discussed in the LFS (maybe BLFS) text. It's possible to add such, though complicated.

That said, I'd still strongly recommend LFS and BLFS. They're not great platforms to build directly from, but they're great platforms for learning how an operating system works, with BLFS offering what I'll call 'some refinement'. It's really more about creating a functional system than just the text in LFS.

Which is why I strongly suggest it for anyone who is going to make a serious attempt at creating their own distro.

They expressed wanting to build it from scratch. To me, that implies that they do not want to make their own Debian fork, or something like that. By 'scratch', to me, means that they'll be writing their own package management system.

If they just want to create yet another Ubuntu-derived distro, that's fine -- but not what they're asking. That said, I'd personally take the easy route and just make my own fork from Debian and call it a day.

Well, no... No, I'd definitely not do that. While it might be fun to make my own distro, I have zero interest in maintaining it and supporting it. If I did create my own distro, I'd strongly suggest not using it. In fact, please slap me across the face if I ever mention that I'm going to create my own distro. Slap me twice if I say that I'm serious.
 
It's worth noting that the OP mentioned that he'd already done LFS, and "had no idea where to start". Presumably the next step was to be somewhere beyond LFS. I guess one could consider BLFS as step beyond LFS, but is it really what the OP was looking for? We are not informed about that. One might reasonably suppose that he was somewhat apprised of BLFS because it's sort of the next step which LFS itself mentions at some point.

My mirth at post #6 of @gvisoc was of the sheer compactness of the proposal and an audaciousness in its suggested resolution. The "what can go wrong" expression did induce a smile too, since so many things can actually mess up in these sorts of relatively large projects. Again, though, the suggestion depended on LFS which seemingly the OP has moved on from.

Post #5 made some suggestions that looked towards a deeper look at operating systems than LFS. There's a difference between constructing an operating system from the bottom up, so to speak, say working from assembly programming such as this simple OS here: https://mikeos.sourceforge.net/write-your-own-os.html, or building the OS through programming languages such as C described in Tanenbaum's book on operating systems, as opposed to putting various pre-formed pieces of software together like a jig-saw puzzle where the pieces themselves may each involve small processes to get the pieces to fit. Pardon the rough analogy. LFS falls into the latter category, and it's conceivable the OP wants something more thoroughgoing than that. If that's the case, then it may be that programming is going to be the place to go to become familiar with the tools that make both applications and operating systems. That was behind the references made in post #6. One seemingly reasonable suggestion from the osdev site was to become a developer of a program as a step before becoming a creator of an operating system. That would apply as much to a linux system as any other system I would think.
 
Last edited:
To create a Linux (distribution) From Scratch, you have to:
  1. Create new packaging and package distribution system, or pick an existing one.
  2. Then do Linux From Scratch until you have a neat running system, "golden master".
  3. Install the tools of #1 on your working LFS
  4. Start packaging what you have chosen as "the golden master" for other to reproduce with the system in #1.
  5. Get another machine and place it on your desk, and install your new distribution from scratch until it's usable.
  6. At this point you would have obtained the first machine running your new distribution, allowing you to leave LFS behind. You would have to duplicate this machine to obtain:
    1. A testing machine, to do user testing of your builds.
    2. A build machine 100% running your on distribution.
EASY!, what can go wrong.

For example, install LFS, install rpm-tools, and begin building RPM and dependency relationships.
Thank you that was very helpful. This is probably going to just be a hobby thing but you never know. I just have an old laptop as a server right now but I am in the process of building a pc right now so I'll have a good build machine then. :)
 


Follow Linux.org

Members online

No members online now.

Top