The Crusty Dev

This is not, how to: install Linux

Today marks the day the Windows 10 reaches it End Of Life support. Move on and install and OS that respects you!


This is a general concepts of what the most Linux distributions expect of their users.

If you want to fully switch you have to commit and use it everyday, no back tracking on how you did things in the past. Overtime you will figure out your workflows and build muscle memory with the new OS.

Complete freedom can be daunting at start, but when you get comfortable, you can’t imagine doing it any other way.


Distributions

Fedora, Linux Mint, Ubuntu, Arch, Void, Debian etc.


Their is a magnitude of distributions to choose from, some targeted for specific use cases others are just a blank slate to enable the user to setup and configure to their own liking.

If you are a new commer to the eco-system of Linux OS’s your best bet is to go with the ‘beginner’ friendly distro’s. Such as Linux Mint, Ubuntu, POP-OS. These have nothing short of any other distro, only that the developers have put in the work to make it as ’user friendly” as possible eliminating some hurdles that one can come across and are not experienced on how to do it.

How most common GNU/Linux systems are build.

Linux is just the kernel, it is responsible for interacting with the hardware of your computer and making how that H/W works, it’s translates electrical current to 1010’s for the rest of the operating system to know what you want from it. As someone who is migrating to the new operating system it’s highly doubtful that you would want to interact with the kernel directly. It’s job is to be a out of sight as possible.

In most cases the user interacts with the GNU basic app’s that make the OS actually usable. Such program are : ls, grep, cp, and others that come with the basic tool set to make your computer usable and not just a dumb box in the corner. In recent years you can run a Linux kernel without the GNU toolset but that is something that a new user would not even know it exists.

ergo the term GNU/Linux .


Boot loader

The boot loader is the program that "boots" you operating system to life.In other words it selects the kernel to boot the system and start it. One of the most common boot loaders is GRUB2. If you dual boot a Linux/Windows machine that's the place where you would select which operating system you would like to load. If you decide to do a fresh install of Linux on your machine and wipe Windows and for some reason you want to reinstall Windows, the Windows install will erase your GRUB2 . Microsoft in notorious for not wanting any other OS running the PC their OS is installed.And there's a bunch of steps you need to go through to get your GRUB2 back.

The Grub Boot loader


Systemd & other init systems

In Unix-like computer operating systems, init is the first process started during booting of the operating system. Init is a daemon process that continues running until the system is shut down. It is the direct or indirect ancestor of all other processes and automatically adopts all orphaned processes. Init is started by the kernel during the booting process; a kernel panic will occur if the kernel is unable to start it, or it should die for any reason. Wikipedia


Overview of Init Systems

Init SystemDescriptionKey Features
SystemdA system and service manager for Linux, designed to be fast and efficient.
  • Parallel service startup
  • Dependency management
  • Socket and D-Bus activation
  • Unified logging with journald
  • Timer units for scheduled tasks
SysVinitThe traditional init system used in Unix-like operating systems.
  • Sequential service startup
  • Uses shell scripts for service management
  • Simplicity and familiarity
  • Limited dependency management
OpenRCA dependency-based init system used primarily in Gentoo and Alpine Linux.
  • Lightweight and simple
  • Uses shell scripts for service management
  • Supports parallel startup
  • Dependency management through runlevels
runitA cross-platform init scheme that emphasizes simplicity and speed.
  • Fast service startup
  • Service supervision
  • Minimalistic design
  • Easy to configure

Detailed Comparison

Systemd

  • Advantages:
    • Parallelization: Systemd can start services in parallel, significantly reducing boot time.
    • Dependency Management: It understands service dependencies, ensuring that services start in the correct order.
    • Unified Logging: With journald, it provides a centralized logging system, making it easier to manage logs.
    • Socket Activation: Services can be started on-demand when a request is made, saving resources.
  • Disadvantages:
    • Complexity: The learning curve can be steep due to its extensive features and configuration options.
    • Monolithic Design: Some users criticize it for being too integrated and complex, leading to potential single points of failure.

SysVinit

  • Advantages:
    • Simplicity: It is straightforward and easy to understand, using simple shell scripts for

      The everything is a file concept

      The concept of "everything is a file" in Unix and Unix-like operating systems is a fundamental principle that simplifies the way the system interacts with various resources. This concept means that all types of data and resources are treated as files, allowing for a consistent interface for users and applications.

      This design philosophy enhances the flexibility and power of the Unix operating system, allowing users and applications to treat all resources as files, regardless of their nature. This approach not only streamlines operations but also contributes to the overall elegance and efficiency of Unix-based systems.


      Debian the ‘Mother’ distro

      Debian is one of the oldest distro’s still in active development since 1993. So a one would expect it’s a great starting point to base an other distribution.

      The reason behind it is because the Debian developers make an extra effort to make it a stable as possible, that why the only official release is Debian-stable. You have the freedom to switch to other branches of Debian such as Testing (the next iteration of the stable release) or even SID( still in development)

      The philosophy behind on how it’s build. In simple words :

      “They release when it’s ready”.!

      Debiab Premium Distro

      But on average the release is, in 24 months cycles

      Linux Distro Timeline


      Package management

      Distro’s that base off Debian are: Ubuntu Linux Mint Debian Edition,MXLinux to name some. Check out distrowatch for a complete list of distributions. A side note, don't get overwhelmed with the plethora of distro's available. If you are a new user Linux Mint for example is a great starting point to start your journey.

      The reason mentioning this is not the distro it’s self it’s it package manager and that it offers a solid base system to build off of.

      The package manager is responsible for installing/removing software, it also responsible for figuring out dependencies that said selection of software needs to be fully functional. Before package managers you would need to ‘hunt’ down those dependency files to make the software work. It was tedious, time consuming and nerve wrecking at times. So package managers bring a whole new meaning to Quality of Life upgrade to managing software/dependencies.

      I should know I first started out with Slackware back in 2000 and Slackware shipped as a traditional OS. It collected the said versions of software that OS would need to be complete and then it would be released. Now if you wanted to use some software, that it was not with shipped version. You would need to find the software pkg and it’s dependencies and some times you would need a specific version of a dependency, making it even more tedious because of versioning conflicts. On top of that some software would need to be compiled on your system, not that compiling is a bad thing it’s just to developer specific, than an everyday user would do. So yeah package managers have carried a lot of weight off the shoulders of users and have made life quite easy.

      As a general rule of thumb always choose native packages over 3rd party software distribution. See flatpack, snaps.

      Different pkg managers / distribution specific (apt,dnf, etc.)

      The package manager is the software tool that is the vital component that installs and removes software from your computer. These are the more common you will find and interact with.


      APT: Advanced package tool

      The apt tool is the essential tool to install/remove software from your computer. Even the GUI software app is just a front end for it.

      Key commands

      • apt update
      • apt upgrade
      • apt dist-upgrade
      • apt autoremove
      • apt autoclean

      Major Linux Package Managers


      Package ManagerAssociated DistributionsDescriptionCommand Example
      APTDebian, Ubuntu, and derivativesAPT (Advanced Package Tool) is known for its ease of use and extensive repositories. It manages .deb packages.sudo apt install package_name
      RPMRed Hat, Fedora, CentOS, openSUSERPM (Red Hat Package Manager) handles .rpm packages and is the basis for many distributions.sudo rpm -ivh package_name.rpm
      DNFFedora and RHEL-based systemsDNF (Dandified YUM) is the next-generation version of YUM, used to install, update, and remove packages.sudo dnf install package_name
      YUMRed Hat, CentOS (older versions)YUM (Yellowdog Updater Modified) is an older package manager for RPM-based distributions, now largely replaced by DNF.sudo yum install package_name
      PacmanArch Linux and derivativesPacman is the package manager for Arch Linux, known for its simplicity and powerful features. It handles both binary and source packages.sudo pacman -S package_name
      ZypperopenSUSEZypper is the command-line interface for managing packages in openSUSE. It supports RPM packages.sudo zypper install package_name

      Distributions types:

      Distribution TypeDescriptionExamples
      Rolling ReleaseContinuous updates without major version changes. Users get the latest software versions as soon as they are available, ensuring the system is always current.Arch Linux, openSUSE Tumbleweed, Manjaro
      Periodic ReleaseFixed release schedules, usually with significant updates or new versions at set intervals (e.g., every 6 months or annually). Users perform upgrades to receive the latest features.Ubuntu (periodic), Fedora, RHEL
      Semi-Rolling ReleaseCombines aspects of both rolling and periodic releases. Core components are updated on a rolling basis while certain larger updates are released periodically.openSUSE Leap, Ubuntu LTS (Long-Term Support) with backports enabled

      Detailed Explanation

      1. Rolling Release

      Advantages:

      • Always up-to-date with the latest features and security patches.
      • No need to perform major upgrades; everything is incremental.

      Disadvantages:

      • Stability can sometimes be an issue, as newer packages may introduce bugs.
      • Requires more frequent maintenance and user attention.

      2. Periodic Release

      Advantages:

      • Stability and reliability are prioritized, as packages undergo extensive testing before release.
      • Users can plan upgrades around release schedules and often have long-term support.

      Disadvantages:

      • Software can quickly become outdated between releases unless the user performs updates manually.
      • Requires more work to upgrade between major versions, which can involve significant changes.

      3. Semi-Rolling Release

      Advantages:

      • Offers stability of periodic releases while allowing some flexibility in keeping up with newer software.
      • Reduces challenges of major upgrades by providing continual updates for core components.

      Disadvantages:

      • Users must still deal with periodic major upgrades which can be disruptive.
      • May not always have the very latest software available, unlike rolling releases.

      Each type of distribution has its own benefits and challenges, catering to different user needs and preferences. Rolling releases are great for users who want the latest features, while periodic and semi-rolling releases are better suited for those prioritizing system stability.


      File System Basics: Understanding the Hierarchy

      The Root Directory ("/")

      The root directory is the starting point of the file system hierarchy, represented by a single forward slash "/". All other directories and files are organized under this single root.

      Common Directories Under Root

      DirectoryPurpose
      /binContains essential user command binaries (like ls, cp, mv).
      /bootStores files needed for booting the system, including the kernel.
      /devHouses device files that represent hardware devices (like disks, input devices).
      /etcContains configuration files for the system and installed applications.
      /homeUser home directories are stored here (e.g., /home/user_name).
      /libContains essential libraries needed by the binaries in /bin and /sbin.
      /mediaMount points for external storage devices (like USB drives).
      /mntTemporary mount point for filesystems.
      /optOptional software packages and add-on applications are stored here.
      /procVirtual directory for system and process information (like CPU usage).
      /rootHome directory for the root user (superuser).
      /srvContains data for services provided by the system.
      /tmpTemporary files created by applications are stored here.
      /usrContains user utilities and applications, further subdivided into /usr/bin, /usr/lib, etc.
      /varStores variable data like log files, databases, and websites.

      GUI’s or Graphical User Interface

      Graphical User interface is the prime method you interact with the computer if you are using it as a desktop/workstation. Thanks to M$ and Apple most users are a acquainted with GUI’s . As is customary there are plenty GUI’s to choose from for the use of a Linux system.

      The Linux ecosystem offers a diverse range of GUIs and desktop environments, catering to different user preferences and hardware capabilities. Whether you prefer a feature-rich environment like KDE Plasma, a lightweight option like XFCE, or a modern interface like GNOME, there is a DE that can meet your needs. Users can choose based on their workflow, system resources, and personal preferences, making Linux a highly customizable operating system.

      Some notable GUI’s are :

      • GNOME
      • KDE
      • XFCE
      • LXDE
      • & more

      GNOME and KDE are the ones most distro’s choose to ship with because they offer a full desktop experience and have accommodated for what a desktop user would need in everyday computing. But there is no one stopping you from installing multiple GUI’s and switching back and forth until you make the decision on which one works for you.

      Other GUI’s WM’s (window managers)

      Window Managers (WMs) are essential components of graphical user interfaces in Linux and Unix-like operating systems. Unlike Desktop Environments (DEs), which provide a complete user experience with panels, applets, and integrated applications, window managers focus specifically on the management of windows on the screen. Here’s a detailed overview of window managers in the Linux ecosystem.

      What is a Window Manager?

      A window manager is responsible for controlling the placement and appearance of windows within a graphical user interface. It handles tasks such as:

      • Opening, closing, and resizing windows.
      • Managing window focus and stacking order.
      • Providing decorations (borders, title bars) for windows.

      Window managers play a crucial role in the Linux graphical environment by providing users with control over how windows are displayed and managed. Whether you prefer a tiling window manager like i3 for efficient keyboard navigation or a stacking window manager like Openbox for a more traditional experience, there are many options available to suit different workflows and preferences. The flexibility and customization options offered by window managers make them a popular choice among Linux users, especially those who prioritize efficiency and control.

      Popular Window Managers

      1. i3

      • Type: Tiling Window Manager
      • i3 is a popular tiling window manager that is highly configurable and designed for efficiency. It allows users to manage windows using keyboard shortcuts, making it ideal for power users.
      • Key Features:

      • Dynamic tiling with multiple layouts.
      • Workspaces for organizing windows.
      • Configurable through a plain text file.

      2. Openbox

      • Type: Stacking Window Manager
      • Openbox is a lightweight stacking window manager that is highly customizable. It can be used as a standalone WM or as part of a minimal desktop environment.
      • Key Features:
      • Simple and fast with low resource usage.
      • Customizable menus and themes.
      • Supports window rules for specific behaviors.

      3. Awesome

      • Type: Tiling Window Manager
      • Awesome is a highly configurable dynamic window manager that uses the Lua programming language for configuration. It is designed for advanced users who want to customize their environment extensively.
      • Key Features:
      • Dynamic tiling with multiple layouts.
      • Highly extensible through Lua scripts.
      • Integrated support for widgets and system monitoring.

      4. Xmonad

      • Type: Tiling Window Manager
      • Xmonad is a tiling window manager written in Haskell. It is known for its stability and minimalism, allowing users to define their layout and behavior through Haskell code.
      • Key Features:
      • Automatic tiling and window management.
      • Configurable through Haskell scripts.
      • Lightweight and efficient.

      5. bspwm

      • Type: Dynamic Window Manager
      • bspwm (Binary Space Partitioning Window Manager) is a dynamic window manager that uses a binary space partitioning algorithm to manage windows. It is controlled through a separate program called bspc.
      • Key Features:
      • Dynamic tiling with a focus on keyboard control.
      • Highly customizable through shell scripts.
      • Supports multiple monitors and workspaces.

      The Terminal Console

      The Terminal console is not that hard to use, it’s actually more efficient when you get acquainted with it. It’s the basic method of interfacing with your computer, before GUI’s the terminal was the only option to interface.


      Terminal Console Cheatsheet

      System info

      cat /etc/os-releaseShow distribution name/version and metadata.
      uname -rShow running kernel version.
      hostnamectlDisplay or change hostname and basic system info.

      Filesystem & navigation

      pwdPrint current working directory.
      ls -lahList files with sizes, show hidden files and permissions.
      cd /homeChange directory to /home.
      tree /home/<username>Show directory tree (install tree if missing).
      du -sh *Show disk usage of items in current directory.

      File viewing & editing

      cat /etc/hostsPrint file contents to terminal.
      less /var/log/syslogView large files page-by-page (q to quit).
      nano /etc/hostsSimple terminal editor; Ctrl+O save, Ctrl+X exit.
      sudo nano /etc/hostsEdit protected file as root.

      Users & permissions

      whoamiShow current username.
      idShow UID, GID and group membership.
      sudo -lList commands allowed via sudo for your user.
      sudo usermod -aG sudo <username>Add user to sudo/admin group.
      chmod 644 file.txtSet owner rw, group/other r.
      chown user:group file.txtChange file owner and group.

      Package management

      apt updateRefresh package lists (Debian/Ubuntu).
      apt upgrade -yUpgrade installed packages non-interactively.
      apt install <package>Install package (Debian/Ubuntu).
      dnf updateUpdate packages (Fedora/RHEL).
      dnf install <package>Install package (Fedora/RHEL).
      pacman -SyuUpdate system (Arch).
      pacman -S <package>Install package (Arch).
      zypper refreshRefresh repos (openSUSE).
      zypper install <package>Install package (openSUSE).

      Systemd & services

      systemctl status <service>Show status and recent logs for a service.
      systemctl start <service>Start a service now.
      systemctl stop <service>Stop a running service.
      systemctl restart <service>Restart service (stop then start).
      systemctl enable <service>Enable service to start at boot.
      journalctl -u <service> -n 200 --no-pagerShow last 200 log lines for the service.
      journalctl -b --since "1 hour ago"Show logs from current boot since one hour ago.

      Networking

      ip addrShow interfaces and assigned addresses.
      ip routeShow routing table and default gateway.
      ping 8.8.8.8Test basic IP connectivity.
      nmcli device statusNetworkManager device status (desktop).
      nmcli connection showList saved NetworkManager connections.
      sudo ip link set eth0 upBring interface up (requires root).

      Hardware & drivers

      lspci -kList PCI devices and kernel drivers in use.
      lsusbList USB devices.
      lsmodList loaded kernel modules.
      dmesg | lessView kernel ring buffer messages.
      sudo lshw -shortDetailed hardware summary (root for full info).

      Disks & mounts

      lsblk -fShow block devices, filesystems and mountpoints.
      df -hShow mounted filesystems and free space.
      mount | column -tShow current mounts formatted in columns.
      sudo mount /dev/sda1 /mntMount partition (adjust device path).
      sudo umount /mntUnmount previously mounted filesystem.
      swapon --showList active swap devices/files.

      Logs & troubleshooting

      journalctl -p err -b --no-pager | tail -n 50Show recent error-level logs from current boot.
      dmesg | grep -i errorFilter kernel messages for errors.
      tail -n 200 /var/log/syslogShow last 200 lines of syslog (Debian-family).

      Repair & recovery

      systemctl restart <service>Restart a service then inspect logs.
      journalctl -u <service> -n 200 --no-pagerView recent service logs to diagnose issues.
      apt --fix-broken installAttempt to fix broken dependencies (Debian/Ubuntu).
      dpkg --configure -aConfigure unpacked packages left in intermediate state.
      mount /dev/sda2 /mntChroot mount step from live USB (adjust device).
      for dir in /dev /proc /sys /run; do mount --bind $dir /mnt$dir; doneBind pseudo-filesystems into chroot.
      chroot /mntChange root into installed system for repair.
      update-grubRegenerate GRUB config (Debian/Ubuntu example).

      Backup basics

      rsync -a --progress /home/ /media/backup/home/Efficiently copy/backup home directory to external mount.
      tar -czvf backup-home-$(date +%F).tar.gz /home/<username>Create compressed tarball of home.
      timeshift --createCreate system snapshot (install Timeshift first).

      Quick fixes

      rebootReboot system (clear transient issues).
      df -hCheck disk usage — full disks cause many failures.
      journalctl -p err -b --no-pager | tail -n 50Surface recent errors quickly.
      ping 1.1.1.1Quick network connectivity test.
      apt updateRefresh package lists before installs (use your distro's command).

      Safety / Nuclear option

      Critical: back up all personal data before performing a clean install or destructive recovery. Ensure recovery/live USB and verified ISO are available.
      systemctl status <service>Check if a service is running before drastic changes.

      Help & documentation

      man <command>Open manual page for a command.
      <command> --helpShow usage/help for a command.
      apropos <topic>Search man pages for a topic.
      grep -R "pattern" /etcSearch configuration files for text patterns.
      Think before you sudo/root!