What is Linux?
Linux is a UNIX® clone OS
based on MINIX,
created in 1991 by Linus Torvalds from the University of
Helsinki. Torvalds controls all changes and releases of the
Linux kernel.
For close to three decades, Linux has been one of the most
commonly used and most reliable OSs for servers in the market,
no matter what paid third-party reports that are plaguing the
internet indicate.
Most Linux distributions include a collection of programs
that run on the Linux kernel like X, KDE, GNOME, Cinnamon,
Xfce, LXQt, Mate or other desktop environments as well as
LibreOffice and other office or home utilities. Under the Linux
name, you can get RHEL (paid subscription, enterprise
licensing), Fedora (originally based on RHEL), Oracle (based on
RHEL), Debian, Ubuntu (based on Debian), Mint (based on
Ubuntu), openSUSE (forked from SUSE), Slackware (based on the
now-defunct Softlanding Linux System), Arch Linux (inspired by
Slackware) and many others. For more information on
distros and how popular they are, visit the DisroWatch
website.
When Linux became popular (c. 1995-99), you could buy disks
for any distribution (distro) from the developers or
third-party vendors. Nowadays you would most likely download
the distro of your choice as an .ISO and copy
(dd) it to USB drive (/dev/sdb1) making sure
you have selected the correct sdbx.
dd if=linux_image.iso of=/dev/sdb1
Installing Linux:
Before trying to install Linux, get a full inventory of what
your hardware. In the past, you might have had to help the
installer recognize the hardware and/or fully rewrite the
configuration (config) files. Nowadays installer
shipped with the distro takes care of most the
configuration.
Boot from the USB drive and sit back. The only thing you
would have to decide is if you want to format the whole drive
or share it with another OS as well as entering your
credentials (root access) and network information
(802.11 if needed).
Depending on the distro, you might need to update
your installation right away. If the distro is based
on Debian and it has apt as in the case of Ubuntu and
its derivatives, you might want to run the following commands
on the console as superuser (sudo -i) for
root access.
apt update && # to update `apt` repo list
apt upgrade -y && # to upgrade local packages
apt autoclean -y && # to clean leftover packages
apt autoremove -y && # to remove leftover packages
apt purge -y && # to purge old packages
reboot -n # to reboot machine now
The latter runs multiple commands as a single statement —
one after another using the && (and)
operator and then reboot without confirmation using the
-y (yes) attribute. Of course if you do not
need to reboot exclude the last && operator and
the reboot -n command. I would recommend doing the
latter on a daily basis to make sure your system has the most
up-to-date packages and to avoid security risks.
You can also install packages using apt calling the
correct package name after you have updated the data from the
repository in order to make sure that you are getting the
latest packages.
apt install --y <package_name>
apt install -y build-essential # compiler collection by GNU
apt install -y calibre # ebook manager, reader and creator
apt install -y ddgr # DuckDuckGo via command line
apt install -y dosbox # DOS emulator for games and applications
apt install -y fastfetch # system information utility
apt install -y gimp # image manipulation program
apt install -y git # version control system
apt install -y htop # process viewer similar to `top`
apt install -y lynx # text-only web browser
apt install -y mc # terminal file manager
apt install -y nano # command line text editor
apt install -y nasm # assembly language by Netwide Assembler
apt install -y python3 # language that we should all learn
apt install -y python3-pip # package manager for `python3`
apt install -y sqlite3 # relational database with no GUI
apt install -y tidy # utility to tidy up HTML code
apt install -y vlc # multimedia player
apt install -y whois # access to the `whois` database (domain registration)
If you do not want the system to ask you for confirmation,
you can include -y (yes) attribute, before
the name of the package.
apt install -y <package_name>
apt install -y build-essential
If you are interested in installing multiple packages at the
same time, you would also need to use the double ampersand
operator (&&) after each call. Note the latter can
be written as a single statement.
apt install -y build-essential &&
apt install -y calibre &&
apt install -y ddgr &&
apt install -y dosbox &&
apt install -y fastfetch &&
apt install -y gimp &&
apt install -y git &&
apt install -y htop &&
apt install -y lynx &&
apt install -y mc &&
apt install -y nano &&
apt install -y nasm &&
apt install -y python3 &&
apt install -y python3-pip &&
apt install -y sqlite3 &&
apt install -y tidy &&
apt install -y vlc &&
apt install -y whois
Aside from apt, another common package manager that
most distros include is Flatpak (flatpak),
which can install applications at the user level without the
need of root access.
flatpak install <repository> <package_name>
flatpak install flathub com.vscodium.codium # Visual Studio clone
To update Flatpak packages, the request is similar to that
of apt.
flatpak update -y
Flatpak also provides a means to repair damaged
packages.
flatpak repair
Flatpak also provides a list of its packages installed in
your machine.
flatpak list
The latter two commands other than getting the list of
Flatpak packages can be added to the apt script.
apt update && # to update `apt` repo list
apt upgrade -y && # to upgrade local packages
apt autoclean -y && # to clean leftover packages
apt autoremove -y && # to remove leftover packages
apt purge -y && # to purge old packages
flatpak update -y && # to update Flatpak repo list
flatpak repair && # to repair Flatpak packages
reboot -n # to reboot machine now
Aside from Flatpak and apt, another common package
manager that most distros can use is snap,
which is developed by Canonical.
snap install <package_name>
snap install bottom # memory management
Note that snap might be blocked by default so you
might need to follow the proper steps provided for the
distro. For example, for Mint Linux, you would need to
rename /etc/apt/preferences.d/nosnap.pref
or move it to another location using sudo -i.
mv /etc/apt/preferences.d/nosnap.pref /etc/apt/preferences.d/nosnap.pref.old
Once snap is no longer blocked, you can install
it.
apt update && # to update repository list
apt install -y snapd # to install snap (`snapd`)
Note that snap updates packages automatically
without user interaction four times a day.
For documentation on how to use apt, snap
or other program, refer to the man (manual)
page for each program.
man man # manual for program `man`
If you prefer, you could have the same commands in a script.
For the code below, we will use upgrade.sh.
#!/bin/bash # to call the `bash` shell
apt update # to update `apt` repo list
apt upgrade -y # to upgrade local packages
apt autoclean -y # to clean leftover packages
apt autoremove -y # to remove leftover packages
apt purge -y # to purge old packages
flatpak update -y # to update Flatpak repo list
flatpak repair # to repair Flatpak packages
reboot -n # to reboot machine now
If you prefer to write (tee) the output to the
terminal as well as to a file (update_"$run_date".log
with argument --a to add each output to the same log
file) where $run_date is the date and time (timestamp)
that the script is executed. I prefer to save these files in
case I need to review errors or to make sure that a certain
binary has been updated, especially at work. Note that
user_name is the user saving the log files.
Also note that you do not have to reboot your machine, but it
is always a good idea after any major system change.
#!/bin/bash # to call the `bash` shell
run_date=$(date +%Y%m%d%H%M%S) # to declare variable to hold the timestamp
if [ ! -d "/home/user_name/.update_log" ]; then
mkdir -p /home/user_name/.update_log
echo "created directory `/home/user_name/.update_log`"
fi # to make subdirectory `.update_log` on first run
apt update | tee /home/user_name/.update_log/update_"$run_date".log
apt upgrade -y | tee /home/user_name/.update_log/update_"$run_date".log -a
apt autoclean -y | tee /home/user_name/.update_log/update_"$run_date".log -a
apt autoremove -y | tee /home/user_name/.update_log/update_"$run_date".log -a
apt purge -y | tee /home/user_name/.update_log/update_"$run_date".log -a
flatpak update -y | tee /home/user_name/.update_log/update_"$run_date".log -a
flatpak repair | tee /home/user_name/.update_log/update_"$run_date".log -a
# to write each output to console and output file
reboot -n # to reboot machine now
In order to run the script, we first need to change the mode
(chmod) of the script (upgrade.sh).
chmod 777 upgrade.sh
At this point, the script is an executable and it can be
executed as superuser (sudo -i) preceeded by
./, which tells the system to execute the script.
./upgrade.sh
Note that I started playing with Red Hat Linux 5.2 (11/1998)
and then 6.0 with GNOME (10/1999), but most of my experience
since 2011 has been with Ubuntu distros, developed by
Canonical and based on Debian. Therefore most of what I cover
in this page is related to Ubuntu distros. I used to
like KDE (both on Linux and FreeBSD),
but I no longer do after version 3 (sorry, but no more Kubuntu
for me). I have also played with Unity (Ubuntu), GNOME (Ubuntu
GNOME), LXQt (Lubuntu), Cinnamon (Mint & Ubuntu Cinnamon) and
Xcfe (Mint Xcfe & Xubuntu).
Linux Mint Xfce, My Current Distro of
Choice:
Linux Mint is based on Ubuntu, which is based on Debian.
Linux Mint offers three diffent desktop environments —
Cinammon, Xfce and Mate. I am currently using Linux Mint 22.3
Xfce (Zena), which has less animations and therefore uses less
resources than the Cinnamon version — not to mention the
old-school look and feel.
By default, the screen fades out when the system is idle or
locked — a simple, boring blank screen. Neither
xscreensaver nor xfce4-screensaver are part
of the image. If you decide to install a screensaver, you need
to disable the light-locker deamon (Screen
Locker) and add the screen saver package of your choice to
Application Autostart (Settings Manager >
Session and Startup) to start the deamon on boot.
Although xscreensaver is the classic option, it
does not offer a clean integration. The login screen to stop
the screen saver is generic and looks somewhat out of date. If
this is your preference, run the following code.
apt install -y xscreensaver xscreensaver-data-extra
You will need to call xscreensaver in
Application Autostart to start the deamon on boot.
xscreensaver -nosplash
I prefer xfce4-screensaver as this version includes
the Floating Xfce screen saver with the Xfce mascot
named Xue and offers a cleaner integration with Linux
Mint Xfce. This is the screen saver included in Xubnutu and
other distros with Xfce. If this is your preference,
run the following code.
apt install -y xfce4-screensaver
You will need to call xfce4-screensaver in
Application Autostart to start the deamon on boot.
xfce4-screensaver -nosplash
After you make the changes, you will need to reboot.
Although many people seem to enjoy the latest and greatest
technologies, I prefer stable systems without too many bells
and whistles (fewer distractions, the better). This is why I
often opt for vintage technologies or, in the case of
computers, systems that look old. I am satisfied with my
current installation on a laptop running at 2.7 GHz with 4 GB
of RAM.