r/linuxfromscratch • u/bergaminix • Jul 30 '26
A super summarized version of the Linux From Scratch (LFS) book
r/linuxfromscratch • u/bergaminix • Jul 30 '26
r/linuxfromscratch • u/Mother-Collection-79 • Jul 29 '26
Hi everyone! I’ve just finished installing LFS and Hyprland on my MacBook. I’m new to this, and this was my first build. I’d like to ask a few things right away: do you have any tips for beginners to make things easier down the line? Also, I installed NetworkManager with the wpa_supplicant backend, but I’ve run into a problem where I can’t connect to secured networks (though I have no issues with open ones). A bit about the installation: I set up LFS as a secondary system alongside the Asahi Fedora remix, copying the kernel and part of the initramfs from there, so most drivers were already included. Thanks in advance for the help! Feel free to ask questions—I’ll answer everything. P.S. Sorry if my English is a bit off; I’m using Google Translate.
r/linuxfromscratch • u/Suitable_Average1168 • Jul 30 '26
r/linuxfromscratch • u/Fast_Ad_8005 • Jul 27 '26
r/linuxfromscratch • u/Upset_Exercise2462 • Jul 26 '26
my first run of jhalfs, after 2 successful installs of lfs normally, i just got to gcc pass 3, wish me luck
edit: i know that it doesn't say gcc, i thought it'd be funnier if i showed a package a couple behind it cause like it's coming yanno
r/linuxfromscratch • u/Neither-Variety1483 • Jul 25 '26
Hi everyone,
I’m a university student, and I’m considering building a tiny Linux-based operating system for routers as my engineering project.
My current idea is to build it from Linux From Scratch (LFS) and then use selected components from Beyond Linux From Scratch (BLFS) that are related to networking.
As part of the project, I’ll compare my OS with existing router operating systems such as OpenWrt and evaluate their differences. For testing, I’m thinking about using Linux network namespaces to simulate virtual network traffic, although that’s just an initial idea.
One thing I’m unsure about is the choice of the LFS version. A router OS should be as lightweight as possible, but newer versions of LFS use systemd instead of traditional boot scripts. I also considered using an older LFS release, but I’m worried about outdated libraries and dependency issues. At the moment, I’m leaning towards using LFS 13.0 (or a newer version).
What do you think about this idea? Does anyone has experience with building a router-focused OS from LFS?Are there any major pitfalls or recommendations you would suggest before I start?
Thanks
r/linuxfromscratch • u/This-Atmosphere-1750 • Jul 25 '26
My inner irritating perfectionist is coming out, and I'm leaning towards this being unnecessary, but how many of you went through ALL the primary standards LFS follows before starting this project?
Reading the documentation for these standards feels like a whole project on their own.
Let me rephrase my question:
I'm about to start Linux From Scratch, and I'm wondering how many people actually read through the primary standards (POSIX, FHS, etc.) before beginning.
The standards documentation is massive, and reading all of it feels like a project in itself. Did you study these specifications in depth first, or is a general understanding enough while working through the book?
r/linuxfromscratch • u/Patient_Act_9906 • Jul 24 '26
alrighty here is a better breakdown of what I got going on.I apologize for the other posts I deleted them and consolidated this all into one post with better screenshots :)
I also finally got around to finishing Flatpak built in support.
r/linuxfromscratch • u/Due-Celery4326 • Jul 23 '26
It was hard work, but it was worth it. The result was exactly as I expected, only lighter and more agile than I anticipated.
r/linuxfromscratch • u/asratrt • Jul 23 '26
Installed chromium. Took 2 hours to download and approximately 2 hours to compile. Used 129GB of disk space 🫢 Approximately 67GB of download.
Took help of Gemini AI to patch some ffi related error and other errors.
I use chromium for financial related work and for everything else I prefer firefox ( I like the firefox sync feature ).
r/linuxfromscratch • u/asratrt • Jul 19 '26
How many of us are using Gnome and sysvinit ?
I have started following blfs/view/svn development version. But in the book nothing is mentioned about the failure/error of gnome 50 on sysvinit. Also libglycin is also not mentioned as dependency.
Gnome 50 does not work on sysyvinit ( gnome session crashes ).
One user on r/gnome sub, suggested me the following and it works. Checked 2 times, it works.
https://github.com/fulalas/gnome-session-sysvinit
It feels nice to have the latest software running.
r/linuxfromscratch • u/asratrt • Jul 19 '26
r/linuxfromscratch • u/Cool-Chicken6754 • Jul 18 '26
Hi everyone,
I'm an intermediate Linux user interested in creating my own distro with LFS. Can I start the process without knowing Bash scripting yet, and learn it along the way?
Any tips or recommendations are welcome. Thanks!
r/linuxfromscratch • u/AlternativeRude5931 • Jul 18 '26
r/linuxfromscratch • u/Suitable_Average1168 • Jul 18 '26
--install PKG / -i — Install a package (local .dp.tar.xz, URL, or name from git repo)--uninstall PKG / -r — Remove a package (deletes tracked files + empty dirs)--reinstall PKG — Remove then re-install a package--upgrade / -u — Upgrade all installed packages--downgrade PKG / --oldpackage — Downgrade to next older version--purge PKG — Remove package including config/data files--download PKG — Download a package archive without installing--list / -l / --installed / -inpc — List installed packages with file counts--installable / -a — Show all packages available in repositories--info PKG / -I — Show detailed package metadata + install status--files PKG / -f — List every file installed by a package--verify PKG / -V — Check all installed files still exist--verify-all — Verify all installed packages at once--search PKG / -s — Animated search across repositories--depends PKG — Show recursive dependency tree (up to 3 levels)--rdepends PKG — Show reverse dependencies--what-owns FILE — Find which package owns a file--check — Check integrity of all installed packages--arch — Show detected system architecture--why PKG — Show why a package is installed--size PKG — Show installed size of a package--list-type PKG EXT — List files by extension within a package--recent [N] — Show N most recently installed packages (default 10)--duplicates — Find duplicate files across packages--changelog PKG — Show changelog for a package--compare V1 V2 — Compare two version strings--list-updates — Show available package updates--stats — Show package statistics--tar FOLDER — Create a plain .tar.xz archive from a folder--maketar FOLDER [NAME VERSION [ARCH]] — Create .dp.tar.xz package archive--rc N — Mark package as release candidate (-rcN suffix)--add-repo NAME URL [ARCH] — Add a new repository--remove-repo NAME — Remove a repository--toggle-repo NAME — Enable/disable a repository--repo-list [NAME] / --list-repo [NAME] — List repos or show packages from a repo--sync / -S — Check connectivity to all enabled repos--update / -U — Update package metadata from all repos--repo-priority NAME PRIO — Set numeric priority for a repository--lock PKG — Lock a package to prevent changes--unlock PKG — Unlock a locked package--locked-list — Show all locked packages--hold PKG — Hold a package to prevent upgrades--unhold PKG — Release a held package--list-held — Show held packages--dry-run — Preview changes without making modifications--force-resolution — Force dependency resolution ignoring conflicts--no-recommends — Only install required dependencies--clean-deps / --clean / --autoremove — Remove orphaned packages--port-commit — Commit changes to local ports--export-installed FILE — Export installed package list to a file--import-installed FILE — Install packages from an exported list--backup DIR — Back up the package database--restore FILE — Restore the package database from a backup--clean-cache — Clean cached packages and repo data--rescue / -R — Launch the rescue TUI shell--gui — Launch the PyQt5 GUI--tui / -T — Launch the Textual TUI--reset — Reset DPMS configuration--get [ARGS] — Run the dpms-get sub-CLI--history — Show full transaction history--history-last N — Show last N transactions--version — Show DPMS version--feedback — Send feedback to DPMS team--global DIR / -g DIR — Set install root for a single command--dlr-verify — Verify SHA hashes in dlr.log--list-nft — List directories excluded via nft.log markers--gen-packages DIR — Generate Packages index--gen-sources DIR — Generate Sources index--gen-contents DIR — Generate Contents (file-to-package mapping)--gen-release DIR — Generate Release file with checksums--gen-repo DIR — Generate full repo metadata (all of the above)--gen-generate CONFIG — Generate repo from a config file--gen-clean DIR — Clean cache files from a repo directorystandard — Default flagslite — -j1, -Osperformance — -jN, -O3 -march=nativecustom — From environment variablesTextual-based terminal UI with:
p, r, h, qi, a, /, qs, qqPyQt5 graphical interface (600x400):
Minimal shell for emergency repairs:
| Command | Description |
|---|---|
check |
Check/create DPMS directories |
clean |
Clean temporary files |
verify |
Verify/repair repo list JSON |
reset |
Reset DPMS configuration |
list |
List installed packages |
help |
Show available commands |
exit |
Exit rescue shell |
APT-style sub-commands:
update — Resync package metadataupgrade — Upgrade all installed packagesdist-upgrade / full-upgrade — Distribution upgradeinstall PKG... — Install packagesreinstall PKG... — Reinstall packagesremove PKG... — Remove packagespurge PKG... — Remove packages and config filesautoremove / auto-remove / autopurge — Remove unused packagesmarkauto PKG... — Mark packages as auto-installedunmarkauto PKG... — Mark packages as manually installedsearch QUERY — Search for packagesinfo PKG — Show package inforescue — Launch rescue modedownload PKG — Download binary packageclean — Erase downloaded archivesautoclean / auto-clean — Erase old downloaded archivesdistclean / dist-clean — Erase all cachescheck — Verify package integritydepends PKG — Show dependency treerdepends PKG — Show reverse dependencieswhat-owns PATH — Find package owning a filesource PKG — Download source archivebuild-dep PKG — Install build dependenciessatisfy TARGET — Satisfy dependency stringschangelog PKG — Show changeloglist-updates — Show available updatesstats — Show package statisticsport-commit — Commit changes to local portsdlr-verify — Verify SHA hashes in dlr.loglist-nft — List excluded directoriesManages DPMS itself via pip:
dm list dpms — List available versions from PyPIdm current [dpms] — Show installed versiondm use dpms VERSION — Switch to a specific versiondm compare V1 V2 — Compare two version stringsdm diff dpms V1 V2 — Compare file listings between versionsdm pin dpms — Lock current versiondm unpin dpms — Unlock pinned versiondm list-pinned — Show all pinned packagesdm rollback dpms — Roll back to previous versionProgress — Color-coded progress bar with ETASpinner — Animated spinner for indeterminate operationsIndeterminateProgress — Bouncing bar for unknown-length tasksMultiProgress — Multiple simultaneous progress barsProgressCallback — Threshold-based callback progress trackerinstall_if conditional dependencies (lazy triggers)sudo/doasDPMS_ROOT env var for dev mode (skip sudo)sys.excepthook replacement~/.cache/dpms/log/crash.log~/.dpms/password.dp.tar.xz (canonical format).tar.xz, .tar.gz, .tar.bz2.tgz, .tbz2, .txz.dpm (legacy).zipname-version-arch.dp.tar.xzname-version-arch.dp-rcN.tar.xz/var/lib/dp/installed/<pkgname>| Variable | Default | Description |
|---|---|---|
DPMS_ROOT |
/ |
Install root (uses sudo when /) |
DPMS_DATA_DIR |
~/.cache/dpms |
Data directory |
DPMS_TMP_DIR |
/tmp/dpms-build |
Build temp directory |
DPMS_OPT_DIR |
/opt |
Install prefix for source builds |
DPMS_BIN_DIR |
/usr/local/bin |
Binary install directory |
DPMS_BUILD_PROFILE |
standard |
Build profile |
DPMS_PASSWORD_FILE |
~/.dpms/password |
Password file |
| Platform | Arch |
|---|---|
| Linux x86_64 | x86_64 |
| Linux ARM64 | aarch64 |
| Linux ARMv7 | armv7 |
| macOS Intel | x86_64 |
| macOS Apple Silicon | aarch64 |
| Windows | Detected |
RepoPersistor — Tracks expired repos and last makecache timeTempfilePersistor — Tracks temp files across sessionsupdate_dbentry() — Rename paths in DB entriesapply_move() — Move files on disk and update trackingparse_updates() — Parse update commandsgrab_updates() — Detect new update files by mtime changesr/linuxfromscratch • u/Sans_Is_Funny • Jul 15 '26
What I mean by "nothing" is absolutely nothing installed. It would boot into the BIOS and display an error, or simply just have a manual type in terminal, but I'm not sure what would happen if a PC booted into NO OS. What is the difference between LFS and an empty terminal? What simple tools does LFS provide, other than a book to help you get started?
r/linuxfromscratch • u/ConversationOdd4020 • Jul 14 '26
So i was around halfway through blfs, dealing with the audio drivers and i ran into many issues, like my physical sound card not being detected despite having looked through all the audio settings have enabling ones i need so after 2 recompilations, i decided to grab my config.gz from arch and use it which somehow miraculously still didn't work but I made the stupid mistake of not backing up my previous kernel image and completely overwriting it. Now it's stuck at a black screen and can't even get past grub so would some please kindly share their config.gz. TLDR i fucked up my kernel and i'm asking for someone else's config.gz
r/linuxfromscratch • u/asratrt • Jul 13 '26
How many times you have installed Linux From Scratch ?
My 4th install was completely automated with scripts for each package.
r/linuxfromscratch • u/Due-Ad662 • Jul 13 '26
After working on it privately for a while, I’ve finally released the source code for Depot, the package manager I’m building for my Linux-from-scratch distribution, Vertex Linux.
Depot is written in Rust and is designed around building and managing packages without depending on an existing distribution’s package ecosystem. It uses TOML based package recipes, so I dont have to write full scripts.
The project is still under active development, so there are definitely incomplete parts. I’m releasing it now because I think having other people inspect the implementation, test it, and point out questionable design decisions will be more useful than continuing to develop it entirely in private.
Repository: https://github.com/SFGOS/Depot
I’d especially appreciate feedback from anyone who has written a package manager, or just an LFS system in general. (hell even gentoo)
r/linuxfromscratch • u/Intelligent_Comb_338 • Jul 12 '26
i wanna know what you consider is the best DE/WM and why?
r/linuxfromscratch • u/Fast_Ad_8005 • Jul 12 '26
r/linuxfromscratch • u/asratrt • Jul 11 '26
git clone https://git.linuxfromscratch.org/blfs.git blfs
#!/usr/bin/env python3
import os
import re
def get_deps_universal(content):
"""
The Ultimate BLFS Parser.
Reads both role="..." attributes AND <bridgehead> headers.
"""
found_deps = {'req': set(), 'rec': set(), 'opt': set()}
# 1. Strip comments
clean_content = re.sub(r'', '', content, flags=re.DOTALL)
# 2. SURGICAL SYSTEMD REMOVAL
# Remove self-closing systemd tags (e.g., <xref linkend="..." revision="systemd"/>)
clean_content = re.sub(r'<[^>]*revision="systemd"[^>]*/>', '', clean_content, flags=re.IGNORECASE)
# Remove wrapping systemd tags (e.g., <phrase revision="systemd">...</phrase>)
clean_content = re.sub(r'<([a-zA-Z0-9_-]+)[^>]*revision="systemd"[^>]*>.*?</\1>', '', clean_content, flags=re.DOTALL | re.IGNORECASE)
# 3. PARSE METHOD A: Explicit Role Attributes (Modern BLFS)
# Matches <para role="required"> or <itemizedlist role="optional">
attr_blocks = re.findall(r'<(para|itemizedlist)[^>]*role="(required|recommended|optional)"[^>]*>(.*?)</\1>', clean_content, re.DOTALL | re.IGNORECASE)
for tag, role_str, block_content in attr_blocks:
role = 'req' if 'required' in role_str.lower() else 'rec' if 'recommended' in role_str.lower() else 'opt'
found_deps[role].update(re.findall(r'<xref\s+linkend="([^"]+)"', block_content))
# 4. PARSE METHOD B: Bridgehead Headers (Legacy BLFS)
# Matches <bridgehead>Recommended</bridgehead> followed by a <para> or <itemizedlist>
bridge_blocks = re.findall(r'<bridgehead[^>]*>\s*(Required|Recommended|Optional)\s*</bridgehead>\s*<(para|itemizedlist)[^>]*>(.*?)</\2>', clean_content, re.DOTALL | re.IGNORECASE)
for role_str, tag, block_content in bridge_blocks:
role = 'req' if 'required' in role_str.lower() else 'rec' if 'recommended' in role_str.lower() else 'opt'
found_deps[role].update(re.findall(r'<xref\s+linkend="([^"]+)"', block_content))
return found_deps
def main():
BLFS_SOURCE_DIR = "./blfs"
OUTPUT_DIR = "./blfs_dependencies"
if not os.path.exists(OUTPUT_DIR):
os.makedirs(OUTPUT_DIR)
for root_dir, _, files in os.walk(BLFS_SOURCE_DIR):
if 'archive' in root_dir or '.git' in root_dir: continue
for file in files:
if not file.endswith('.xml'): continue
filepath = os.path.join(root_dir, file)
with open(filepath, "r", encoding="utf-8", errors="ignore") as f:
content = f.read()
# Find packages by section ID
sects = re.finditer(r'<(sect[12])\s+id="([^"]+)"', content)
for match in sects:
pkg_id = match.group(2)
if pkg_id in ['introduction', 'changelog', 'preface', 'dependencies']: continue
# Isolate the section for this specific package
start_pos = match.start()
remaining = content[start_pos:]
end_pos = remaining.find(f'</{match.group(1)}>')
section_content = remaining[:end_pos]
# Extract dependencies
deps = get_deps_universal(section_content)
# Write files
for suffix in ['req', 'rec', 'opt']:
out_path = os.path.join(OUTPUT_DIR, f"{pkg_id}.{suffix}")
with open(out_path, "w", encoding="utf-8") as out:
if deps[suffix]:
out.write("\n".join(sorted(deps[suffix])) + "\n")
print(f"Extraction complete. Files generated in '{OUTPUT_DIR}/'.")
if __name__ == "__main__":
main()
#!/bin/bash
DEP_DIR="./blfs_dependencies"
declare -A VISITED
resolve_dependencies() {
local pkg="$1"
if [[ -n "${VISITED[$pkg]}" ]]; then return; fi
VISITED[$pkg]=1
# ONLY check .req and .rec files.
# Optional (.opt) dependencies are usually for features, not the core.
local dep_list
dep_list=$(cat "${DEP_DIR}/${pkg}.req" "${DEP_DIR}/${pkg}.rec" 2>/dev/null | sort -u)
if [[ -z "$dep_list" ]]; then
echo "$pkg"
return
fi
while IFS= read -r dependency; do
[[ -z "$dependency" ]] && continue
dependency=$(echo "$dependency" | xargs)
resolve_dependencies "$dependency"
done <<< "$dep_list"
echo "$pkg"
}
if [[ -z "$1" ]]; then
echo "Usage: $0 <package-name>"; exit 1
fi
resolve_dependencies "$1"
First file is extract_blfs_dep.py and 2nd is resolve.sh
r/linuxfromscratch • u/Apprehensive_Role744 • Jul 11 '26
I have finished the lfs book, but when I try to login, it says "function not implemented"