r/linuxfromscratch 15h ago

LibNode Builds

0 Upvotes

Hey, just wanted to share my libnode build repository [https://github.com/I-A-S/libnode-builds\](https://github.com/I-A-S/libnode-builds)

If anyone else here is working with libnode and want prebuilt binary+header archives, this repo builds and publishes the following targets.

1) win-x64 (debug and release variants)
2) win-arm64 (debug and release variants)
3) linux-x64 (debug and release variants)
4) linux-arm64 (debug and release variants)
5) darwin-x64 (debug and release variants)
6) darwin-arm64 (debug and release variants)

and a separate zip file containing headers.

Cheers!


r/linuxfromscratch 2d ago

Package Manager Help

Thumbnail
3 Upvotes

r/linuxfromscratch 3d ago

Making gnome 50 work on sysyvinit

8 Upvotes

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 3d ago

How many of us use gnome

0 Upvotes
25 votes, 1d ago
6 Gnome on SysVinit
19 Gnome on systemd

r/linuxfromscratch 4d ago

Thinking About Building My Own Linux Distribution with LFS – Looking for Advice

13 Upvotes

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 4d ago

Alguien me ayuda con hyprlan linux?

Thumbnail
1 Upvotes

r/linuxfromscratch 4d ago

All dpms commands

1 Upvotes

CLI (dpms) — 120+ flags/arguments

Package Lifecycle

  • --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

Query & Inspection

  • --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

Archiving

  • --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)

Repository Management

  • --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 & Hold

  • --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

Transaction Solver (zypper-style)

  • --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/Import/Backup

  • --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

Cache

  • --clean-cache — Clean cached packages and repo data

Meta

  • --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

Log/Audit

  • --dlr-verify — Verify SHA hashes in dlr.log
  • --list-nft — List directories excluded via nft.log markers

Repo Generation (apt-ftparchive style)

  • --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 directory

Build Profiles

  • standard — Default flags
  • lite — -j1-Os
  • performance — -jN-O3 -march=native
  • custom — From environment variables

TUI (dpms --tui / dpms-tui)

Textual-based terminal UI with:

  • Dashboard — Title screen with navigation buttons (Package Manager, Repository Manager, Transaction History, Quit). Keyboard: prhq
  • Package Manager — Browse Installed/Available packages, real-time search filtering, Install/Remove/Info actions. Keyboard: ia/q
  • Repository Manager — List all repos with enable/disable status, Sync All, Toggle, Add/Remove repos. Keyboard: sq
  • Transaction History — Timestamped log, color-coded (green=install, red=remove). Keyboard: q

GUI (dpms --gui)

PyQt5 graphical interface (600x400):

  • Convert Tab — Select source dir, output filename/path, choose compression (gzip/xz), compress button
  • Download Tab — Enter URL, select output path, download button
  • Shared — Color-coded status log, status bar, threaded operations via QThread

Rescue TUI (dpms --rescue)

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

dpms-get Sub-CLI (dpms --get)

APT-style sub-commands:

  • update — Resync package metadata
  • upgrade — Upgrade all installed packages
  • dist-upgrade / full-upgrade — Distribution upgrade
  • install PKG... — Install packages
  • reinstall PKG... — Reinstall packages
  • remove PKG... — Remove packages
  • purge PKG... — Remove packages and config files
  • autoremove / auto-remove / autopurge — Remove unused packages
  • markauto PKG... — Mark packages as auto-installed
  • unmarkauto PKG... — Mark packages as manually installed
  • search QUERY — Search for packages
  • info PKG — Show package info
  • rescue — Launch rescue mode
  • download PKG — Download binary package
  • clean — Erase downloaded archives
  • autoclean / auto-clean — Erase old downloaded archives
  • distclean / dist-clean — Erase all caches
  • check — Verify package integrity
  • depends PKG — Show dependency tree
  • rdepends PKG — Show reverse dependencies
  • what-owns PATH — Find package owning a file
  • source PKG — Download source archive
  • build-dep PKG — Install build dependencies
  • satisfy TARGET — Satisfy dependency strings
  • changelog PKG — Show changelog
  • list-updates — Show available updates
  • stats — Show package statistics
  • port-commit — Commit changes to local ports
  • dlr-verify — Verify SHA hashes in dlr.log
  • list-nft — List excluded directories

dm — DPMS Version Manager

Manages DPMS itself via pip:

  • dm list dpms — List available versions from PyPI
  • dm current [dpms] — Show installed version
  • dm use dpms VERSION — Switch to a specific version
  • dm compare V1 V2 — Compare two version strings
  • dm diff dpms V1 V2 — Compare file listings between versions
  • dm pin dpms — Lock current version
  • dm unpin dpms — Unlock pinned version
  • dm list-pinned — Show all pinned packages
  • dm rollback dpms — Roll back to previous version

dpms-bar — Progress Bar Library

  • Progress — Color-coded progress bar with ETA
  • Spinner — Animated spinner for indeterminate operations
  • IndeterminateProgress — Bouncing bar for unknown-length tasks
  • MultiProgress — Multiple simultaneous progress bars
  • ProgressCallback — Threshold-based callback progress tracker

Core Engine Features

Dependency Solver (APK-style)

  • Version matching: EQUAL, LESS, GREATER, FUZZY, CONFLICT
  • Solver flags: LATEST, AVAILABLE, REINSTALL, INSTALLED, UPGRADE, REMOVE, IGNORE_CONFLICT
  • Provider system with self-provides + virtual provides
  • install_if conditional dependencies (lazy triggers)
  • Changeset generation (to_install, to_remove, to_upgrade)
  • Queue-based resolution with priority queues
  • Disqualification cascading through reverse dependency chains

Privilege Escalation

  • Auto-detection of sudo/doas
  • Auto re-exec with privileges for root operations
  • DPMS_ROOT env var for dev mode (skip sudo)
  • Read-only ops never need root

GPG / Cryptographic Verification

  • Key import into trusted keyring
  • Signature verification via GPG
  • SHA256 checksum verification

Source-Based Building

  • Source archive download via wget
  • SHA256 verification via USHA256.list
  • Patch application from UPATCHES/
  • Build script execution (UBUILD.sh)
  • Profile-aware compilation

Plugin System

  • Lifecycle hooks: pre_config, config, resolved, sack, pre_transaction, transaction
  • Dynamic loading from plugin paths
  • Glob-pattern enable/disable filtering

Crash Handling & Logging

  • Global sys.excepthook replacement
  • Crash reports to ~/.cache/dpms/log/crash.log
  • Rotating file logs (1MB default, 5 backups)
  • JSON transaction history with IDs and timestamps

Password Protection

  • Interactive password setting
  • Authentication prompt for protected ops
  • Storage at ~/.dpms/password

Package Format

Archives Supported for Installation

  • .dp.tar.xz (canonical format)
  • .tar.xz.tar.gz.tar.bz2
  • .tgz.tbz2.txz
  • .dpm (legacy)
  • .zip

Naming Convention

  • Stable: name-version-arch.dp.tar.xz
  • RC: name-version-arch.dp-rcN.tar.xz

Installation Tracking

  • Database: /var/lib/dp/installed/<pkgname>
  • Content: list of installed file paths (one per line)
  • Enables clean uninstall and integrity verification

Configuration & Environment

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

Cross-Platform Support

Platform Arch
Linux x86_64 x86_64
Linux ARM64 aarch64
Linux ARMv7 armv7
macOS Intel x86_64
macOS Apple Silicon aarch64
Windows Detected

Database Persistence Layer

  • RepoPersistor — Tracks expired repos and last makecache time
  • TempfilePersistor — Tracks temp files across sessions
  • All persistence uses JSON on disk

Package Update / Rename Tracking

  • update_dbentry() — Rename paths in DB entries
  • apply_move() — Move files on disk and update tracking
  • parse_updates() — Parse update commands
  • grab_updates() — Detect new update files by mtime changes

r/linuxfromscratch 7d ago

What is the difference between LFS and absolutely nothing?

4 Upvotes

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 8d ago

Help out a fellow lfs user

5 Upvotes

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 9d ago

My 4th Gnome Linux From Scratch install

Post image
26 Upvotes

How many times you have installed Linux From Scratch ?

My 4th install was completely automated with scripts for each package.


r/linuxfromscratch 9d ago

I finally released the source code for Depot, my package manager for Vertex Linux

15 Upvotes

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 10d ago

what DE/WM do you use for LFS?

11 Upvotes

i wanna know what you consider is the best DE/WM and why?


r/linuxfromscratch 10d ago

Linux From Scratch: almost five months on

Thumbnail gallery
39 Upvotes

r/linuxfromscratch 10d ago

Package database/list for package manager ( Using Gemini AI )

0 Upvotes

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 11d ago

I actually did it.

28 Upvotes

r/linuxfromscratch 11d ago

Initgroups function not implemented

2 Upvotes

I have finished the lfs book, but when I try to login, it says "function not implemented"


r/linuxfromscratch 13d ago

Customized LFS build

Post image
21 Upvotes

I’m so very very happy with the build I have gotten done so far building it on VBox, but it boots on bare-metal already too


r/linuxfromscratch 13d ago

How do I keep my gnome sysvinit desktop updated ?

4 Upvotes

How can I find which is the latest gnome version i.e which website and what packages should I install. The current version is 50.3 but my desktop has 48.

In the svn link of the book it is mentioned gnome shell 50.3 requires mutter 50.3, how to find these dependencies.

And how editors of the book check for updates because there are more than 1000 packages in the book , how do they manage checking for new versions. Do editors manually check for new versions ?


r/linuxfromscratch 13d ago

My daily use system with gnome, sysvinit, zram,btrfs

Post image
26 Upvotes

Now I understand many things about large distros. It's much harder to get rid of systemd in Gnome; it was a lot of work and a headache. Some Gnome functions are already directly using systemd libraries. Honestly, I almost gave up when one last attempt worked and I was encouraged to finish/polish it, but the result was incredibly satisfactory. I can't believe it; I couldn't use Gnome in large distros because of limited memory, only 5GB. Gnome in large distros already started with more than 1GB.And I don't know if the fact that sysvinit also helped, I'll do the same polishing on KDE Plasma later to see what I can achieve in terms of lightness and performance.


r/linuxfromscratch 13d ago

Dpms 1.1.2 is out

Thumbnail
0 Upvotes

r/linuxfromscratch 14d ago

Release notes for 1.1.2 or 1.12

Thumbnail
0 Upvotes

r/linuxfromscratch 19d ago

Any dedicated package manager for LFS?

3 Upvotes

Ive been wanting to try Linux from scratch lately but not having a stable package manager always pulls me back, and I want to know if are there any "universal" package managers or even dedicated to LFS directly.


r/linuxfromscratch 20d ago

Is it possible to build a functional KDE plasma in an LFS system? Yes.

Thumbnail
gallery
86 Upvotes

r/linuxfromscratch 20d ago

Suggesting for making a LFS based distro

9 Upvotes

Hi, I was tryna make MikuOS from Arch but I decide to switch it to LFS instead, and i dunno how do I make it and what do I need, can anyone had a sort of road map or suggestion for me so I can work on it?

Thanks


r/linuxfromscratch 21d ago

I built my first package manager in Rust while building my own Linux distro from scratch (WIP)

19 Upvotes

Hey everyone!

A few months ago I started building my own Linux distribution from scratch using LFS/BLFS. After manually compiling everything (GCC, glibc, systemd, XFCE, etc.), I realized something:

LFS doesn't really give you a package manager. You're expected to keep building and installing everything manually.

Now, I know that's kind of the whole point of LFS. It's meant to teach you how Linux actually works by making you do everything yourself, and I think that's exactly how it should be. Chiral isn't meant to replace that learning experience. It's aimed more at people who have already finished LFS/BLFS (or projects like GLFS/GLinux From Scratch) and want something to manage packages afterward instead of compiling everything forever.

So... I decided to build one.

It's called Chiral, and it's a cross-distro package manager written in Rust. The long-term goal is to make it work across as many Linux distributions as possible. I know that's a huge challenge, and I'm sure there are going to be edge cases, but I'm learning as I go.

Right now it can:

- Install packages with dependency resolution

- Remove packages while tracking installed files

- Search packages

- Show package information

- Update packages and self-update

- Work on custom LFS systems and other Linux distributions

It currently falls back through:

  1. My own GitHub package repository

  2. Debian repositories

  3. Arch Linux repositories

The dependency resolver walks the full dependency tree and installs packages in the correct order. It also tries to detect software that's already installed using package managers, "pkg-config", "ldconfig", "PATH", and filesystem checks so it doesn't reinstall things unnecessarily.

It's far from finished. I'm still working on:

- Orphan package detection ("autoremove")

- Better conflict detection

- Improving dependency handling

- Supporting more distributions (or at least as many as I can)

This is honestly my first time writing something this large in Rust or building low-level Linux tooling, so I'm sure there are plenty of things that can be improved. I'd really appreciate feedback, bug reports, suggestions, or anyone willing to test it on different distros.

GitHub:

https://github.com/Amaterus1125/Chiral-CrossDistro-Package-Manager

I'd love to hear what you think, especially from people who have experience with package managers, Linux distributions, or LFS. Any feedback is welcome!