Linux - History, Terms, and Concepts


PDP-8/L 12-bit minicomputer, introduced in 1968

Motivation - Why Linux and Open Source

As a choice for practical reasons

Some statistics

"Linux rules all the clouds now, including Microsoft's own Azure.", ZDnet, 2019

"StatCounter reported that desktop Linux reached over 4% market share for the first time." zdnet.com, March 2024. From the same source: Windows 72.13%, MacOS 15.46%, Linux 4.03%, ChromeOS 2.26%

See also

Big Tech Giants and Personal Values

As a choice for principal reasons

"Some users prefer Linux due to its focus on open source and user freedom, which aligns with their personal values." 10 Reasons Why Linux Is Taking Market Share From Windows, iOS

Big Tech: Too Big, Too Powerful -- untrustworthy searches, self-promotion, product placement, data collection, dynamic pricing, ... consumerreports.org

Selected acquisitions:

See also

Why Desktop Linux instead of Windows -- just a few more reasons

See also:

History

In the 1960s batch operating systems still dominated computing; writing and running software was awkward and far from user-friendly. Programmers submitted their code on punched card or paper tape; operators scheduled and ran the program and returned results hours (or days) later. New time-sharing systems were in development to allow for sharing computing resources by many users. Multi-tasking and interactive operation were to make computer programming more accessible, particularly with the new and much more affordable minicomputers. Multics was one of the early time-sharing systems, started in 1964 by MIT, GE, and Bell Labs, but the project was not doing well, and Bell withdrew from it in 1969.

In terms of lines of code: Linux System = Linux Kernel (6%) + GNU software (15%) + other free software (79%)

See also:

Terms

File systems

File systems provide a unified interface to physical media for applications i.e. program code for reading and writing files to hard disk, USB stick, and SD card is identical. File systems differ in terms of (among other things)

Often file names are given and cannot be changed. However, if you have the choice, consider the following:

Here is an overview of the most commonly used file systems:

Buffers and Page Cache

When applications read or write files the system does not implement each access as a physical operation on the disk; this would result in very poor performance. Instead, files are copied to RAM where they stay for some time so subsequent requests can be performed much faster. A large amount of available RAM is therefore beneficial for performance.

Buffers are used for I/O operations that move data between storage devices, such as from RAM to disk.

The page cache is an area of memory where file content is stored for faster access. This area is typically much larger than the buffers and can occupy a significant part of the total RAM, leaving very little free memory, since the cache memory can be quickly re-allocated for programs if needed. Memory usage is only meaningful when listed for programs and cache separately.

Under normal conditions the system takes care of the buffering and page caching without the user noticing, with the exception of removable drives like USB sticks which need to be 'unmounted' or 'ejected' before physical disconnect in order to make sure that any data in memory can be written to the device before it is unplugged.

Encodings

Character encodings are used to translate byte streams into characters displayed on the screen. The hard drive contains files which in turn contain bytes. Each byte contains 8 bits, therefore a single byte can encode 256 different characters.

The ASCII code (American Standard Code for Information Interchange) is a 7 bit code. Its 128 positions are occupied by the characters used in the English language, and some control characters used in data communication. Each character is encoded in one byte.

The ISO 8859-1 character encoding contains the ASCII characters as the first 128 entries, and other characters used in Western European languages in the remaining 128 positions. Each character is encoded in one byte.

UTF8 is the standard encoding for Unicode. The Unicode project aims at providing support for all characters used by any major community in the world. Currently the Unicode table contains about 110,000 characters.

From the position in the Unicode table the UTF8 encoding of the character can be derived:

UTF8 is becoming the standard in information processing. However, many applications still use other encodings, and this continues to cause problems.

Note that the ASCII characters have the same byte values in all three encodings described above. Files containing only ASCII characters have the best chance of being correctly transferred across different types of systems and processed by whatever application software will work on them. For this reason it is still a good idea to only use ASCII characters if at all feasible.

Network Basics

Linux and Unix systems are usually connected to the Internet, and often function as servers i.e. provide a number of services to the outside world.

In order to achieve data communication between networked computers (hosts) a number of protocols have to be established; these form the Internet Protocol Suite which is commonly described in the following layers (in the TCP/IP model):

Ethernet is a family of networking technologies commonly used in the LAN (Local Area Network).

DSL (Digital Subscriber Line) is a family of technologies for transmitting digital data over telephone lines.

PPP (Point to Point Protocol) is used to establish a direct connection between two nodes over many types of physical networks, including cellular phone.

IP (Internet Protocol) is used for packet construction, addressing and routing along a number of nodes from source to destination.

UDP (User Datagram Protocol) is a fast and lightweight connection-less protocol. TCP (Transmission Control Protocol) is a slower, heavyweight connection-oriented protocol.

Both UDP and TCP use port numbers: when an application sends a request to a server host, the correspoding service at the destination is identified by port number, since that host may provide a number of different services. Some services are identified by their well-known ports, such as

A firewall is commonly used to allow only certain types of network traffic to certain hosts and ports, thereby avoiding a large number of problems associated with malicious requests. A firewall establishes a barrier against attacks and involves one or more computers or specialized hardware.

If a host is meant to answer HTTP request and allow users to connect via ssh then the ports 80 and 22 have to be open. The following command can be used to find the open ports of a given host, and the services listening on those ports. Scanning for open ports can be interpreted as preparing for an attack, so consider carefully before using this command on hosts outside you own control.

nmap localhost

Note that while this command identifies the open ports on your local host, the results do not mean that those ports are actually reachable from outside your LAN or organisation. A number of port scanner web sites are available to test the ports on your host reachable from the Internet.

Linux Installation

Look at the website distrowatch.com to get an overview of current Linux distributions, their popularity, and their features. Popular distributions are:

  1. Mint is based on Ubuntu and comes in several 'spins' i.e. desktops:
  2. Ubuntu is based on Debian. It comes with the new Gnome 3 desktop which is not universally popular with users, especially those coming from Gnome 2, as the interface design has been changed considerably and for no good reason, many would feel, the present author included. By switching to the 'Classic' desktop upon login the traditional Gnome 2 design can be restored to some extent.
  3. Debian is the system of choice for servers. It can be run on the desktop, but this is best left to more experienced users.
  4. Fedora is another popular choice; this one is not based on Debian.

The choice of desktop is not critical, you can always install additional desktops later. Switching to another distribution can be a hassle; the software will be basically the same, but all those personal configurations need to be migrated, and many things will work slightly differently -- expect some headaches. Better choose once and stick with it.

Download the ISO image

32 or 64 bit: today 64-bit is the only sensible choice for practically everyone. Nearly all current desktop computers and notebooks work in 64-bit mode. The main difference is memory addressing. A 32-bit pointer can address 2^32 = 4294967296 bytes of memory i.e. 4 GB, a serious limitation when PCs today come with 8 GB of RAM or more.

Download the ISO file, e.g. for Linux Mint 21.3 Cinnamon: linuxmint-21.3-cinnamon-64bit.iso

Checksum: The download is about 3 GB; it is very unlikely but possible to end up with a corrupted image file. Therefore, also download the checksum file sha256sum.txt and compare with the hash of your downloaded ISO file. On Windows open a CMD prompt, go to your download directory, and enter:
certutil -hashfile linuxmint-21.3-cinnamon-64bit.iso SHA256
type sha256sum.txt
Compare the hashes (at least the first and last few chars)

Or, if you are feeling lucky, just forget about the checksum and hope for the best..

VirtualBox Installation

You can install Linux inside a virtual machine such as VirtualBox (Open Source, Developer Oracle). Virtualization is very common in IT, and some experience with the concept is useful. Modern operating systems and hardware support virtualization in various ways. However, you may need to enable those options in the BIOS (called e.g. Intel VT or AMD-V).

Pros and Cons of this method:

For trying things out, comparing various distributions, and getting comfortable with the Linux system the VM is a sensible option. For gaming or other applications that depend on full support for the 3D functions of your graphics card or iGPU the VM is definitely not a good choice.

Steps:

  1. Download the software from virtualbox.org
  2. in Windows you may also need the Visual C++ runtime
  3. Start VirtualBox and create a New VM
  4. as ISO file use your downloaded Linux ISO image
  5. Skip unattended install
  6. Defaults for Memory, CPU, and virtual disk image (VDI) are probably fine
  7. Once the VM is created, check the parameters
  8. start the VM, it should boot from the ISO file
  9. you are now running the Linux live system and can install from there
  10. you probably want to go to full screen mode
  11. During the installation you can use Erase Disk, Use Entired Disk or similar since it refers to the virtual disk file
  12. At the end of the installation the Enter key may not do anything, you need to Power Off the VM in VirtualBox
  13. Check the VM parameters again: the IDE/Optical drive should now be empty
  14. Start the VM and it should boot into your new Linux system

Once the guest is installed you can

☆ Performance benchmarking is notoriously tricky, what do we mean by performance? How fast the system boots and applications start up, how sluggish or snappy the GUI interactions are, CPU number crunching, file IO, or everything together, but weighted how? Here is a basic CPU benchmark using the 7z compression package which comes standard in Linux Mint; done on a Lenovo X200 (2.4-GHz Intel Core 2 Duo, 4 GB RAM, 2009)

This indicates a performance loss on CPU-only tasks of about 20% because of virtualization; the subjective user experience for the whole Linux system would suggest a much higher value.

Dual-boot Installation

This means you have to select the OS at the start of your session i.e. when you boot your computer. You get the full performance of your hardware, and also all the support for your GPU that your Linux distro offers. The process is certainly not rocket science, but you can erase your existing operating system, if you are not careful. The re-partitioning of the hard disk or SSD can lead to nasty situations. Definitely backup all your user data before you start.

Partitions: For a very basic desktop system you only need one partition mounted as / (root) with a minimum size of about 20 GB (Mint). Unless your hard disk or SSD space is severly limited about 50 GB (at least) is a more reasonable choice.

Swap space: The installer suggests to create a swap partion, but for a desktop installation with a single Linux system it is more flexible to use a swap file which can be set up later.

/home partition: by default /home is in the system partition so the disk space can be shared among system and user data; however, there are a few advantages to having a separate /home partition, such as keeping your data and user settings when you upgrade to a new major release of your distribution. On the other hand, you can do this e.g. with the Backup and Restore tool. In both cases there is a chance of incompatible user settings. When in doubt stick to the default i.e. no separate /home partition.

Encryption

Encrypting the home directory is usually, but not always, a good idea.

Notebooks: encryption is very much recommended - they can get lost or stolen easily. Obviously it means using a sufficiently strong login password. See section Tools/Keyring for details.

A strong password should be at least 12 characters long and must not be based on dictionary words. Use upper case, lower case, and digits, but do not substitute digits for letters: good old simple passwords like netw0rk or g0ldf1sh can be cracked almost instantly nowadays.

Desktop PC: they tend to be at a much lower risk of theft or loss compared to laptops, and home directory encryption comes with some downsides:

For these reasons many people opt for other encryption solutions on their desktop, such as using it only on a particular folder. Tools are e.g. gocryptfs (apt-get install gocryptfs) and veracrypt.

Encrypting only the home directory is a sensible option; however, the swap space can also contain private data, at least for a short period of time, so encrypting the swap space as well is still a reasonable choice. Encrypting the complete Linux system is not sensible in most cases.

Boot Menu

After the installation is finished you will see the boot manager taking over at startup. It shows the boot menu and allows you to choose an operating system for this session.

After installation the boot manager defaults to the new Linux system. Once the system is up and you are logged in the default can be changed with

sudo grub-set-default n

in a terminal window, where n is the number of the entry you see in the boot menu (index origin zero!).

Even if you do not intend a dual-boot setup the installation will still use the boot manager. However, you can set the grub timeout to something like 2 seconds to speed up the startup. Do not set it to 0, you want to be able to go into rescue mode (without a USB stick containing the live system, which is always an option).

WSL is not Linux

The Windows Subsystem for Linux. Some Pros and Cons:

Note that all the cons very much benefit Microsoft.

There are two versions of WSL, but in fact they are very different products:

There is no login, WSL starts the shell with the default user and requests no password.

WSL is often praised for simplifying the development and testing in Windows/Linux environments:

WSL 2 is generally an improvement over WSL 1, but it is not better in every respect, e.g. since WSL 1 is not virtualization, there is no performance hit -- if programs run, then they run at native speed.

It is possible to install Linux GUI applications in WSL 1, but you need an X server to run them, e.g. VcXsrv. In WSL 2 it should work after you install some drivers; see e.g. itsfoss.com.

See also:

Some more things to consider in connection with Microsoft and Linux

WSL allows Microsoft to offer all the great free software from the Linux community to their Windows users while still keeping those users in the Microsoft world, treating them with advertising and self-promotion, collecting data, and charging license fees.

However, Windows users can now more easily see the huge amount of high quality free software out there, and may well decide to ditch Windows and Microsoft altogether. It is tempting to view the recent rise in desktop Linux adoption in this light (2.94% in Feb 2023, 4.03% in Feb 2024 according to statcounter, derived from website tracking).

The stringent hardware requirements of Windows 11 may also play a role in the recent rise of Linux; neowin.net, Mar 2024. Combined with runaway inflation after the Covid crisis many users may have chosen not to buy a new computer to upgrade to Windows 11, but instead use Linux on their older hardware. Note that desktop market share of Linux in India, the fifth-largest economy, went from 8.19% in February 2023 to 15.21% in Feb 2024.

See also: "Sick of Microsoft?" Switch to Linux. PCmag, May 2023

Upgrades

In most popular Linux distributions the software comes in 'packages'. This often corresponds to an application, but it may also be software that is used as a component in apps and other packages. It is vital for your system to keep all packages in their proper versions, and install additional packages as needed, e.g. when you install something like the game Wesnoth the package manager will also install a host of other packages that are needed as well. The total number of packages goes into the thousands quickly.

Debian-based distributions like Ubuntu and Linux Mint use the apt package manager. You can upgrade all installed packages by entering on the command line:

sudo bash
apt update
apt upgrade

This should be done regularly. You can also set it to automatic (in Linux Mint: Control Center/Administration/Update Manager).

At some point your release will no longer be supported i.e. new versions of your software can no longer be installed with the package manager.

New Releases

This depends on your distribution; in Linux Mint there are new major versions every other year or so. There are also three point releases (or minor releases). A release is identified by major and minor number and a name, e.g. Linux Mint 19.3 Tricia.

Releases are supported for five years, e.g. Mint 19 was released in 2018 and supported until (end of) 2023. Mint 21 was released in July 2022 and will be supported until April 2027.

Transitions between minor releases such as from 21.2 to 21.3 tend to cause no problems and can be done with the Update Manager: Refresh, then look in Edit.

Going to a new major release is usually not painless. There are several options, and the choice is tricky. Whatever you opt for, backup your home directory first; also make a list of your installed packages. The Backup Tool (in the Administration menu) helps with that; however, it creates a single (possibly huge) tar file. Another simple backup of your home directory is e.g.

rsync -av /home/myuser /media/myuser/myusbstick

This creates a copy of your home directory on your USB stick with all the files and directories, ready to work with. It includes all the dot files and directories that contain your user config for various applications (somewhere in .config and maybe .local), and when you do this again later only the new files will be copied.

The following are feasible options for a major release upgrade, in order of probable usefulness:

You do not have to go to a new major release as soon as it becomes available. As long as your current release is still supported you get the all important security updates. Only go to a new major release when you really want some of the new features. Otherwise better wait for at least the next point release, when the rough edges of the new major have been polished a bit.

Additional Packages

When your system is up and running you may want to start your Software Manager and install some additional packages. There are thousands of packages, here are only a few suggestions:

Check the Software Manager (in the Start Menu) for software. You can install it from there, or on the command line; in Debian-based systems like Ubuntu and Linux Mint open a terminal window and enter:

sudo bash
apt update
apt install wesnoth

..and start playing - just like that.

Running software for other operating systems

Within your Linux session you sometimes want to run software from other operating systems.

Participate!

Even if your programming skills are not top-notch, and you don't have the skill or time to write documentation and tutorials, you can still take part in the Open Source movement with moderate effort: