yujiri.xyz

Software

Learn programming for good instead of profit

Anatomy of a Linux system

Here I'd like to go through the main components of a Linux system. Linux is a very diverse world; almost every detail can vary depending on what distribution you use, but I think a high-level perspective is still useful.

Package management

The way software distribution traditionally works on Linux is very different from what you find on Windows, Mac, or smartphones. On those platforms, when you want to install a prorgam, you go to the program's website and download it, or else you download it from some kind of "app store" run by Microsoft or Google or Apple (but these stores are generally not curated - any registered developer can publish anything to them). On Linux, you normally install things from a repository (like an app store, except all the apps are free software) run by the same people who make your Linux distribution. They take the program's source code, compile it themselves, and host it on this repository, and your distribution comes with a tool for installing things from this repository, called a package manager.

This might seem like a strange and pointless extra step compared to just downloading programs from the people who make them, but there are good reasons for it.

Package managers use special file formats that contain information about packages to install. The two most common package formats are `.deb` (used by Debian, and the many other distributions based on it) and `.rpm` (used by Red Hat, and the many other distributions based on it).

Service management and daemons

Remember that `init` refers to the first process started by the kernel at boot time. Generally, the init process starts something called a *getty* that lets you log in to a terminal (or else a graphical version of a getty that logs you into a desktop environment). `init` also handles something called service management. On some distributions, the service manager is technically a separate program that gets started by init, but the two are often talked about together.

The service manager's job is to start various background programs called services or *daemons*, and supervise them afterward (restart them if they crash, etc). Examples of these services:

The most popular service manager on Linux today is systemd. The old standard is called sysvinit (named after an old version of Unix called System V). There are several less popular alternatives, such as OpenRC and runit.

Desktop environment / window manager

Linux distributions aimed at non-technical users usually ship with a desktop environment preinstalled. This is a more extricable component than the rest - you can, on such a distribution, uninstall the desktop environment and install a different one of your choice, whereas you can't really do that with the package manager or service manager because they're too integrated.

GNU

GNU is an organization that publishes and advocates for free software. A whole lot of important Linux software is maintained by GNU, including a package called coreutils, which contains the core command-line tools like `ls` and `cp` (this is why some people insist on referring to Linux as "GNU/Linux" or "GNU+Linux" since Linux is technically only the kernel and most of the other software involved is GNU). They're also a big proponent of copyleft licensing, so if you see something described as "GNU software", you know that it's free software, with copyleft licensing, for Linux.

Proxied content from gemini://yujiri.xyz/software/guide/linux.gmi

Gemini request details:

Original URL
gemini://yujiri.xyz/software/guide/linux.gmi
Status code
Success
Meta
text/gemini; lang=en
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.

What is Gemini?