Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

What's the "big picture" of how my operating system is put together?

+5
−0

My understanding is that one of the key advantages of Linux is modularity: the actual Linux kernel is quite small, and then what we call Linux is that plus the "rest of the system" - hence "operating system" (or "Linux Systems"). And then the latter is typically, but not necessarily GNU (or should I say "the GNU system", to distinguish it from the organization?), and it's built up of a lot of smaller pieces.

Now, my package manager tells me that I have over 2500 installed packages, but it seems like the system isn't really as complicated as that implies. I know that a single application could account for many packages in some cases (e.g. over 100 of them on my system seem to have something to do with Python). And I've heard nebulous terms like "desktop environment" and "window manager" that seem like they describe conceptually distinct, separable components of this "Linux system".

Is it really like that? Without getting into details about the dependencies between packages, does it make sense to think of them as logically grouped into a few components?

If so, what might those components be? And how modular are they really - can a distro maintainer basically choose an option for each and call it a day; or does everything have to be stitched together at the level of individual software packages and then carefully reconfigured to cooperate properly; or just what?

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.
Why should this post be closed?

1 comment thread

Split multiple questions (5 comments)

1 answer

+0
−0

This varies because, being modular, Linux will have different components according to what it's used for. I'll write mainly for a mainstream desktop distro.

Systemd manages most of the stack these days. At boot, kernel and systemd are started automatically. You can replace the kernel with a variant Linux kernel. Switching to a non-Linux kernel is harder and you're better off just installing something that comes with the kernel you want, like BSD.

Systemd is a recent thing, which is controversial for going against the Unix philosophy you mention. It's a fairly ambitious init system, service manager, device manager, domain resolver... The list keeps growing. Due to this it's getting harder every day to drop-in replace systemd if you don't like it. A much easier option is to start with a non-systemd-distro.

Each type of hardware has some services associated with it. Systemd (or its equivalents) will start these in some logical order.

The most interesting one is graphics: Systemd will start the display manager so that you can have the login GUI. When you do login, the display manager will start a graphics server (X11 or Wayland) and window manager/desktop environment so you get your taskbar, tray icons, etc. Part of the graphics server's functions is handling input from mouse and keyboard.

A "desktop environment" is actually just a kludge of disparate software. Some of it, like the title bar and window manager, go together somewhat. Others, like browser and mail client, make little sense to bundle in but the DEs do because they think it will help them acquire lazy users. Importantly, the way windows behave (maximizing/minimizing, multiple desktops, automatic layouts) is governed by a component of the DE called a window manager, and if you poke a bit you can usually replace the window manager in DEs like KDE/Plasma (this very popular DE is officially renamed to Plasma now, but it's a stupid name with poor searchability; the old name was KDE). You can install multiple DEs and swap them, but there may or may not be some added hassle from dealing with their bundled programs - for example, Kmail is a bit temperamental when used outside KDE because there's some over-coupling with common KDE components like akonadi, that don't make sense if you're not using KDE.

Sound system, networking, bluetooth, printing etc. are also going to have their own services started by systemd. Sometimes the systems don't have a UI, or just a simple CLI, and you install a separate utility to actually interact with it. For example, for sound you'll have some combination of alsa, pulseaudio, pipewire, jack etc. But the nifty GUI for changing your volume with the tray icon could be a program like pavucontrol, or an equivalent that's bundled into something like KDE/Plasma. By contrast, for printing people use CUPS, which already comes with its own Web UI.

Then you have all the "user programs" like browser, editor, etc. Unlike the services, these get started on demand. The developers will usually make them distro-agnostic so that they can run on any Linux (some distros like Debian like to customize them when adding as a package). You can obviously mix and match to your heart's content. Notably, most Linux GUI programs use some common GUI toolkit like GTK or Qt. This will give them a common look and feel (eg. buttons). But if for example you install a Qt program on a system that's been all GTK up to that point, you may be surprised that its UI looks ugly and inconsistent. Usually, each graphics toolkit will have its own configuration & theming utility, which you can install separately to make it look nicer, but making them consistent is largely a manual task.

The main way to install software is the package manager, which is actually what defines the distro. You can install different package managers, but it's usually easier to just use the default one where you can, and if you don't like it, install the distro that comes with the one you want. That said, for example flatpak uses a completely parallel way to install programs, so it's normal to use flatpak along with the default system package manager. Guix is designed to play nice as a second manager too.

Arch Linux is designed around having a very simple install that sets up the bare minimum needed to get a console running, so that everything else can be separately set up by the user according to their needs. The Arch wiki has a lot more information about the specifics.

If you want to go even more low-level, https://www.linuxfromscratch.org/ is a great resource.

History
Why does this post require attention from curators or moderators?
You might want to add some details to your flag.

1 comment thread

More focus on component classification please? (1 comment)

Sign up to answer this question »