Linux

Linux is a kernel developed by Linus Torvalds in 1991. A kernel is the core part of an operating system and acts as a bridge between the system's hardware and the user-level applications.

The kernel is responsible for allocating a proper share of computer resources to each process, like CPU time, memory, and input/output access.

A process, which is a program that has been loaded into memory, along with the resources, allocated by the kernel, it needs to operate. So a process is a running instance of a program, meaning the process is using some computational power in the current time.

There can be multiple instances of a single program and each instance of that running program is a process, like when you open multiple browser windows.

From the init process, which is the first process started by the kernel during boot, to any process running later, the kernel ensures efficient resource management and process isolation. It keeps processes from interfering with each other and facilitates communication between them when necessary, using inter-process communication mechanisms.

Inter-process communication or IPC, refers to the mechanisms and techniques used by programs running on a computer to communicate and share data with each other.

Linux Kernel

The Linux kernel is open source and can be downloaded here.

# display os, hostname and kernel version

uname -a

# display kernel version

uname -r

# find the linux distro and version

cat /etc/*release

Linux Distribution

A distribution of Linux is the kernel packaged with other applications, such as a program that presents a list of wifi networks to the user or a program that lets the user look through a list of files. Linux itself is NOT an operating system, but part of an operating system.

Distribution families are usually broken down by the package manager they use. A package manager is a program used to automatically handle the process of software installation, removal, update, and dependency management.

DNF stands for Dandified YUM and is the next-generation version of the Yellowdog Updater Modified or YUM, a package manager used by Fedora and other RPM-based Linux distributions. It's essentially a software tool that helps you manage the installation, updating, and removal of software on your computer.

RPM itself is both a package format (.rpm) and a low-level tool that handles the installation, updating, and removal of these packages. RPM deals with the direct management of these packages, including unpacking and compiling the software from these packages onto your system. It ensures that the software is correctly installed, files are placed in the right directories, and the necessary scripts are run.

DNF, on the other hand, operates at a higher level and is essentially a front-end tool that uses RPM in the background for handling the actual packages. DNF provides more advanced features such as dependency resolution, system updates and group management, which are not handled directly by RPM.

A software repository is a server that offers one or more packages, which is the form installable piece of software comes in.

# search for a specific package

dnf search package_name

# install a package with root privileges

sudo dnf install package_name

We need root privileges to make changes to the system, therefore we need to use the sudo-command to install software on the system.

sudo dnf upgrade --refresh

The --refresh tells the system to ignore any previously saved information about available packages (like what versions are available or which packages are out of date). Instead, it forces DNF to go online and check with the actual repositories to get the latest package info, ensuring you're getting the most up-to-date list of what's available to install or upgrade.

Think of it like refreshing a webpage to see the latest content, --refresh ensures DNF is working with the very latest data about the packages, rather than any old info it might have saved from a previous run. This can be useful if you know there have been recent updates in the repository or if your cached data might be outdated.

sudo dnf system-upgrade download --releasever=41

Change the --releasever=41 to the number you want, if you want to upgrade to a different release. Most people will want to upgrade to the latest stable release, which is currently 41 (when this is written), but in some cases, such as when you're currently running an older release than 40, you may want to upgrade just to Fedora Linux 40. System upgrade is only officially supported and tested over 2 releases at most (e.g. from 39 to 41). If you need to upgrade over more releases, it is recommended to do it in several smaller steps.

If some of your packages have unsatisfied dependencies, the upgrade will refuse to continue until you run it again with an extra --allowerasing option. This often happens with packages installed from third-party repositories for which an updated repository hasn't been yet published.

Automatic Updates

You can use a service to automatically download and install any new upgrades (for example security upgrades). The dnf-automatic package provides a service which is started automatically.

sudo dnf install dnf-automatic

# the default configuration file

sudo nano /etc/dnf/automatic.conf

If you are running a server it might be a good choice to only install security upgrades.

# What kind of upgrade to perform:

# default = all available upgrades

# security = only the security upgrades

upgrade_type = security

To enable and start the systemd timer:

sudo systemctl enable --now dnf-automatic.timer

systemctl list-timers --all