You are on page 1of 37

Linux Platform – I Chapter: 1

Chapter 1:
Introducing and Installing Linux System

- 1 -
Linux Platform – I Chapter: 1

Title Page
1. Unix /Linux OS History 5
2. Linux Distributions and Common Characteristics 7
3. Linux Installation (in brief( 11
3.1. Downloading Centos 7 11
3.2. Preparing the virtual machine environment 13
4. Login and logout 34

- 2 -
Linux Platform – I Chapter: 1

Objectives
Upon completion this chapter, the student should be able to :
1. Understand the difference between UNIX and Linu
2. Choose a Linux distribution and download it
3. Install CentOS 7
4. Logon CentOS and logout

Keywords
Linux, filesystem, UNIX, GNU, FFF, GPL, Linus, distro, Red Hat, xfs, ext2, ext3, ext4,
vfat, swap, CentOS.

- 3 -
Linux Platform – I Chapter: 1

Introduction
An operating system (OS) is a software that lies between the computer hardware
(disks, memory, ports, etc.) and the application programs (word processors, Web
browsers, image viewers, etc.). Without OS, every application program has to know
the details of each piece of hardware. Linux, as OS, consists of the kernel, which
provides the most basic computing functions (managing system memory, sharing the
processor, opening and closing devices, etc.) and basic utilities associated with the
kernel including:
• File System (sometimes written Filesystem): It provides the structure in which
information is stored in files, within a hierarchy of directories, on the computer
hard disks, but also on removable media such as CDs and DVDs .
• System Services: They include processes that mount file systems, start your
network, and run scheduled tasks. Many services run continuously, enabling
users to access files, databases, printers, web pages and other computing
assets over a network.
• User Interface: it is a way for users to run programs and access the file system.
Linux has both graphical and text-based user interfaces. GNOME and KDE
provide graphical user interfaces, whereas shell command interpreters (such as
bash) run programs by typing commands and options.
• Device Drivers: These provide the interfaces to each of the hardware devices
connected to your computer. A device driver enables a program to open the
device, send/receive data, and finally close it.
Linux is a flexible, fast-growing and inexpensive OS. Moreover, Linux is viable platform
for desktop and workstation use as well. Even if you already use Windows,
understanding Linux will give you an advantage when you are looking for a new job.
Nowadays, Linux is everywhere; when you search the Web with Google, or buy an
item from Amazon.com, you use Linux. Big computer companies use Linux today even
those who have dismissed it before, such as Microsoft.

- 4 -
Linux Platform – I Chapter: 1

1. Unix /Linux OS History


Click on the slider to see the most important stages in Linux history.
For a long time, Unix was one of the most popular OSs worldwide due to its good
features such as: high level of security, large support, multitasking, plain text
configuration files, working with wide variety of computers, etc.

1971
In 1971, the first edition of Unix appeared at Bell Laboratories in Murray Hill, New
Jersey. It was developed by K. Thompson and D. M. Ritchie (creator of the C
programming language). More than 60 commands were included in it, such as: chmod
(change access mode), cat (concatenate files), chown (change owner), cp (copy file),
ls (list directory contents); mv (move or rename file) and others.
Most versions of Unix for personal computers are quite expensive. From the very
beginning, AT&T, which owned the UNIX trademark originally, made UNIX into a
commercial product. However, before 1984. AT&T was restricted from selling
computers directly to customers [4]. Therefore, UNIX source code was licensed to
universities for a nominal fee.
1983
On September 27, 1983, R. Stallman announced the GNU project as a free software,
mass collaboration project. The main objective of GNU was to build a UNIX-like free
OS, and R. Stallman decided to call this OS "GNU's not Unix!". R. Stallman founder
and ex-president of the Free Software Foundation (FSF) [5], which has provided
critical infrastructure and funding for the GNU Project. FFF is a nonprofit with a
worldwide mission to promote computer user freedom [5]. The GNU project created
the GNU Public License (GPL), which make anyone able to use the GNU software in
his/her own software, changing and redistributing it. The original software author keeps
the rights to her/his software. Even after repackaging and reselling the software, the
original GNU agreement must be maintained with the software. This differs from
traditional OSs (i.e., Unix, Microsoft Windows, and MacOS), which are proprietary and
far less modifiable. Despite its success producing thousands of UNIX utilities, the GNU
project itself failed to produce an important piece of code: the kernel.

- 5 -
Linux Platform – I Chapter: 1

on a UNIX-like kernel because he wanted to use UNIX –like OS on his personal


computer.
1991
Linux is a freely distributable version of Unix-like OS, originally developed, in 1991,
by Linus Torvalds, a student at the University of Helsinki, Finland. Linus started work
On October 5, 1991, Linus announced the first “official” version of Linux which had
bash (the GNU Bourne Again Shell) and gcc (the GNU C compiler), but not much else
was working. The Linus’s personal mascot (a penguin nicknamed Tux) has been
widely adopted by the Linux community as the mascot of the Linux kernel. Because
of the important contributions of the GNU tools in Linux development from the
beginning, the FSF [5] has requested that distributions of Linux with accompanying
utilities be called GNU/Linux.
Today
Today, Linux is the most successful open source project in history. It is a complete
Unix clone, capable of running the X Window System, TCP/IP, Emacs, Web, mail and
other software. Moreover, commercial distributions are available [4].

- 6 -
Linux Platform – I Chapter: 1

2. Linux Distributions and Common Characteristics


A Linux distribution (or Linux distro) consists of the Linux kernel and the packages that
make up all the commands you can run on the system. All distributions share almost
the same kernel, but the type, format, and number of packages are a little different.
The enclosed table shows you the best distros in 2020 according to journaldev [8]:

Linux distributions have different goals, support, and even popularity. There are
hundreds of independent Linux distributions, but the distributions derived from the
Debian and Red Hat (sometimes RedHat) [9] lineages are most predominate in
production environments in the last years.
Two kinds of Linus distros are available; community versions which are free Linux
distros primarily supported and maintained by the open source community, and
enterprise versions which are enterprise (or commercial) Linux distros available
through a subscription from a vendor and do not only rely on community support.
Since 1999, a big list of distros can be found at lwn.net/Distributions [6]. There is no
best Linux distro because when you work with Linux for long enough, you learn to
customize everything. Therefore, any Linux distro can look and behave like any other
Linux distro when configured to do so. For that reason, you should choose any Linux
distro that you feel comfortable with at the moment. After a while of using it, you will
anyway figure out how to configure it to your likings.
Choosing the right Linux distribution depends on your use case and tool requirements.
Certain Linux distros are designed as desktop environments, others are designed to
support backend IT systems (like enterprise or web servers). You should ask yourself
some questions when choosing your distro, such as:
• Will this distro find a significant rise in popularity for the coming few years and
stay on top of the latest security patches?
• Does this distro have an active non-expensive support and sufficient
documentation?
• Does this distro have all the tools you need?
Red Hat has dominated the Linux world for more than two decades, and its distributions
are widely used around the world. Red Hat Enterprise Linux (or RHEL) is open source
but requires a license. If you are not willing to pay for the license, you are not going

- 7 -
Linux Platform – I Chapter: 1

to be running Red Hat. Although Fedora is sponsored by Red Hat, it is not considered
stable enough for RHEL.
CentOS [7] is an Enterprise-class Linux Distribution derived from Red Hat Enterprise
Linux and it is virtually identical to Red Hat Enterprise Linux, but free of charge. Centos
stands for Community ENTerprise Operating System; it is sponsored (and was owned)
by Red Hat and aims to be 100% binary compatible. It mainly changes packages to
remove upstream vendor branding and artwork. CentOS is shared and enhanced by
thousands of software developers, which release their software under Free and Open
Source Software (FOSS) licenses. The CentOS distribution lacks Red Hat’s branding
and a few proprietary tools, but is in other respects equivalent to it. So, CentOS is an
excellent choice without paying to Red Hat. It provides a secure, low-maintenance,
reliable, predictable and reproducible Linux environment. Since 2003, many versions
of CentOS have appeared. For example, CentOS 7.0-1406 was released on July 7,
2014, but CentOS 7.8-2003 was released on April 27, 2020, and CentOS 8.2-2004
was released on June 15, 2020. Other popular distros are also Red Hat descendants.
For example, Oracle sells a rebranded and customized version of CentOS. Amazon
Linux, available to Amazon Web Services users, was initially derived from CentOS and
still shares many of its conventions. On August 7, 2019, Jake St.Amour wrote top five
reasons to use CentOS 7 [10] and here they are:
• Security: CentOS has multiple built-in security features to protect you from
cyber-attacks. it uses Security-Enhanced Linux (SELinux) which is an access
control mechanism that can enforce rules on processes and files, based on
policies that you define;
• Extended Support: With CentOS, major versions are supported for 10 years
and will receive security updates as needed. CentOS 7 was released on the
7th of July 2014, and will be supported until June 30th, 2024
• Package Management: CentOS uses the YUM (Yellowdog Updater Modified)
package manager to keep your system up to date. This makes the operating
system very modular, meaning you can easily add and remove features as
you’d like.

- 8 -
Linux Platform – I Chapter: 1

• A Wealth of Documentation: There are multiple forums and sites that have
guides about setting up and configuring CentOS properly. CentOS provides an
excellent wiki found in the CentOS wiki.]11[
• Management Panel Support: Lastly, CentOS can support multiple
management platforms including cPanel, InterWorx, WebMin, DirectAdmin,
Spacewalk, CWP, Plesk, ISPConfig, Virtualmin, Vesta CP, and multiple other
platforms.
The previous reasons are only a few of the benefits that CentOS can provide a server
owner! and that is why Centos has been chosen to study Linux OS.

Category Distribution Features Website


easy to use, elegant and
MX Linux (Debian and efficient desktops with https://mxlinux.org/
Lightweight
antiX-based) high stability and solid
performance
similar to Windows, and
lightweight, elegant and
Linux Mint (Ubuntu https://linuxmint.com/
User-friendly comfortable operating
and Debian-based)
system which is both
powerful and easy to use

extremely easy to use for https://ubuntu.com/


For beginners Ubuntu
first-time users

very pretty looking, fast,


Mac OSX Elementary OS open, and privacy- https://elementary.io/
look-a-like (Debian-based) respecting replacement
for Windows and macOS

- 9 -
Linux Platform – I Chapter: 1

Only
essential Manjaro Linux (Arch user friendly, built to be https://manjaro.org/
packages Linux-based) lightweight
added

made with the first time


Linux user in mind,
alternative to Windows
Windows Zorin OS (Debian- and macOS, designed to https://zorinos.com/
look-a-like based) make your computer
faster, more powerful,
secure, and privacy-
respecting

Fedora (Red Hat – designed to be cutting-


Community- https://getfedora.org/
based and sponsored edge in terms of software
built
by Red Hat) technology

designed to be very
Built from https://www.debian.org/
Debian (Independent) stable using basic
scratch
programs and utilities

stable, predictable,
For CentOS (Red Hat- https://www.centos.org/
robust, manageable and
Enterprises based)
reproducible platform

most advanced
For Kali Linux (Debian-
penetration testing https://www.kali.org/
Pentesters based)
distribution, ever

- 10 -
Linux Platform – I Chapter: 1

3. Linux Installation (in brief


This section is a step by step demonstration of an actual installation of CentOS 7 as
a virtual machine in VMWare Workstation 15. Once you have downloaded and installed
the VMWare on your computer, it is time to download Centos 7.

3.1. Downloading Centos 7


For non-enterprise environments, it is better to download the DVD ISO option, which
includes the GUI (Graphical User Interface). So, go to the following URL:
http://isoredirect.centos.org/centos/7/isos/x86_64/,the page looks like the following:

The page changes regularly, so it may look different when you visit it. The page
contains many mirrors, each one is a server that contains copies of CentOS 7 media.
I have selected the http://repo.boun.edu.tr/centos/7.8.2003/isos/x86_64/ mirror just
because my country is sited near Turkey.

- 11 -
Linux Platform – I Chapter: 1

As a novice Linux user, it is better for you to avoid downloading the minimal .iso file,
because you must add new packages every time you need them. However, this task
could be difficult for novice users. You can choose CentOS-7-x86_64-DVD-
2003.iso, which has the GUI and the common servers and utilities you need.

3.2. Preparing the virtual machine environment


After successfully downloading the new software (.iso) file, it is time to prepare the
virtual machine environment.

- 12 -
Linux Platform – I Chapter: 1

Launch the VMware Workstation, the following screenshot will appear:

Click Create a New Virtual Machine.

Select Custom (advanced) as a type of virtual machine you want to create and click
Next.

- 13 -
Linux Platform – I Chapter: 1

Now, you have an option to create a virtual machine and choose its hardware
compatibility. Choose Workstation 15.x and click Next.

Select your guest operating system (OS), and then click Next. You can install the OS
using:
• An installer disc (CD/DVD);
• An installer disc image file (ISO);
• I will install the operating system later.

- 14 -
Linux Platform – I Chapter: 1

Choose the third option and click Next.

Select a guest operating system, choose Linux and click Next.

- 15 -
Linux Platform – I Chapter: 1

Enter a virtual machine name and specify a location for virtual machine files to be
saved, and click Next.

Establish the virtual machine's processor configuration, and click Next.

- 16 -
Linux Platform – I Chapter: 1

Establish the virtual machine's Memory size; choose a value between 1 and 2 GB,
and click Next.

Establish the virtual machine's Network Type; choose Use network address translation
(NAT), and click Next.

- 17 -
Linux Platform – I Chapter: 1

Establish the virtual machine's I/O Comptroller Types; choose LSI Logic
(Recommended), and click Next.

- 18 -
Linux Platform – I Chapter: 1

Establish the virtual machine's Disk Types; choose SCSI (Recommended), and click
Next.

Select Create a new virtual disk, and click Next.

- 19 -
Linux Platform – I Chapter: 1

Specify Disk Capacity (10 GB is enough), then select Split the virtual disk into multiple
files, and click Next.

Specify Disk File, and click Next.

- 20 -
Linux Platform – I Chapter: 1

Verify the configuration settings for your virtual machine: Memory, Processors, CD /
DVD. Network adapter, USB Controller, Sound card and others. In order to change
the configuration settings, just choose Customize Hardware.

Choose Customize Hardware, then select CD/DVD (IDE) settings and click the browse
button to select your downloaded Centos 7 ISO image file.

- 21 -
Linux Platform – I Chapter: 1

Click OK, and finally click Finish.

- 22 -
Linux Platform – I Chapter: 1

3.3. Installing Centos 7


When the virtual machine is powered on, the VMware Tools installation starts. You
should see the next screenshot when booting:

Select Test this media & install CentOS 7

- 23 -
Linux Platform – I Chapter: 1

Select the installation language. It is better to select English, and click Continue.

You should arrive at a summary page (with one or more warnings). All items marked
with a warning icon must be configured before you begin the installation.

- 24 -
Linux Platform – I Chapter: 1

Select the Keyboard option; the system default is English (US); click the plus icon to
add more layouts. Then, click the Options button to define a key combination for
switching between keyboard layouts. When you are satisfied with the settings defined,
click the Done button to confirm the changes.

Select the Language Support option; the language selected in the “Welcome to
CentOS 7” window will be the default system language. If necessary, select additional
languages (e.g., Arabic), then click the Done.

Click the Date & Time icon; select a region/time zone on the map of the world as seen
below, then click the Done.

- 25 -
Linux Platform – I Chapter: 1

Select the Software Selection option under the Software heading. You will see a list
of predefined Base Environment options and optional add-ons. This part entirely
depends on your needs. As a novice Linux user, choose Server with GUI, and add
other software you want, then click the Done.

- 26 -
Linux Platform – I Chapter: 1

Click the Installation Destination option under the System heading. Choose the disk,
select the “I will configure partitioning” checkbox, and then choose Done.

If you want the installation program to create the required file systems and their mount
points for you, select your preferred partitioning scheme from the drop-down menu in
the left pane (default for CentOS is LVM). Try to have at least three partitions:
a. The root, its size is about 8 to 10 GiB; its file system’s mount point is/
b. The boot, its size is about 1 GiB; its file system’s mount point is /boot
c. The swap, its size is at least 1 GiB to 2 times the amount of RAM; its file
system’s mount point should not be set - setting the file system type to
swap is sufficient .
You can add additional file systems and mount points if you need to .
The following table helps you to create your preferred partitioning scheme, it contains
common device types supported by Centos [3] and short description about each one:

- 27 -
Linux Platform – I Chapter: 1

Device Type Description


It can contain a file system or swap space, or it can
Standard Partition provide a container for software RAID or an LVM
physical volume.
Automatically generates an LVM logical volume.
Logical Volume (LVM) LVM can improve performance when using physical
disks

LVM thin Provisioning Allows you to manage a storage pool of free space

And the following table contains the common file systems supported by Centos [3]

File Systems Description


It is a highly scalable and high-performance file system that
supports file systems up to 16 EiB and directory structures
xfs
containing tens of millions of entries. XFS supports metadata
journaling, which facilitates quicker crash recovery.
It supports standard Unix file types, including regular files,
ext2 directories, or symbolic links. It provides the ability to assign
long file names, up to 255 characters
It is ext2 based file system and has one main advantage
ext3 journaling, which improves reliability and eliminates the need
to check the file system after an unclean shutdown
It is ext3 based file system and features; it supports larger
file systems and larger files. It is faster and more efficient
ext4 allocation of disk space, no limit on the number of
subdirectories within a directory, faster file system checking,
and more robust journaling.

- 28 -
Linux Platform – I Chapter: 1

It is a Linux file system that is compatible with Microsoft


vfat Windows long file names on the FAT file system

It is used to support virtual memory. In other words, data is


swap written to a swap partition when there is not enough RAM to
store the data your system is processing

When finished, click the Done button. Then, click Accept Changes.

To disable the KDUMP, uncheck the Enable KDUMP checkbox. Click the Done button
to confirm your changes. KDUMP is enabled by default; it captures system information
at the time of a crash to diagnose the cause of the crash. When enabled, KDUMP
reserves a portion of system memory.

- 29 -
Linux Platform – I Chapter: 1

Click the Network & Host Name. In our example, we will not set the Hostname, we
keep the default value loalhost.localdomain and we will change those values later.
You can do the same thing or change the values according to hostname of your
machine (e.g., studentHost) and the value of your domain name server.

To activate or deactivate a network interface, move the switch in the top right corner
of the screen to either ON or OFF. Select Configure… and select to add IPv4 settings
or IPv6 settings depending on what you have. By default, IPv4 parameters are
configured automatically by the DHCP service on the network. The IPv6 configuration

- 30 -
Linux Platform – I Chapter: 1

is also set to the Automatic method. This combination usually does not require any
changes and suitable for novice users.
Applying a Security Policy is not necessary on all systems [3]. This should only be
used when a specific policy is mandated by your organization rules or government
regulations. If it is the case, choose a profile from the list and hit Select profile then
click Done to confirm your selection.
Once everything is set up according to your liking, hit Begin Installation to start the
install.

To define the root user, select the Root Password icon.

- 31 -
Linux Platform – I Chapter: 1

Enter a strong password and re-enter it in Confirm field, then click Done
Note: you will learn later in another chapter how to choose a strong password.

Select the User Creation option. Add a new system account user by defining the full
name, user name, and password. You have the choice to check the Make this user
administrator checkbox, you can check it if you want to grant the root privileges to that
new user. You have, also, the choice to check Require a password to use this account
checkbox (recommended). After you fill in all of the required fields, click Done.

Wait for the installation process to complete. If you see the screenshot below, then
the installation was successful and you have a boot right into the system, click Reboot
to reboot the system.

- 32 -
Linux Platform – I Chapter: 1

- 33 -
Linux Platform – I Chapter: 1

4. Login and logout


After rebooting your system, you should get the following screenshot. You do not have
to do anything.

A logon screen appears after a couple of seconds. Here, log into the system by using
the credentials you defined previously; you can type root as username. The login
process will then ask your password (nothing will appear on screen when you type
your password).

After logging in, the screenshot below will appears and finally you can start practicing
Linux OS:

- 34 -
Linux Platform – I Chapter: 1

If you have forgotten to create regular user account during installation, you can do it
now because you login as root. To create a regular user, use the useradd as follows:

[root@localHost ~]# useradd username

then, change the password with the passwd command:

[root@localHost ~]# passwd userPassword

Where username is the name of the regular user and userPassword is its password.
To logout the current session, just type exit command:

[root@localHost ~]# exit

Note: When installing the GUI, the screenshot below appears. Using Linux OS with
GUI is out of the scope of our study.

- 35 -
Linux Platform – I Chapter: 1

Questions
1. Who is the Linux creator?
2. What is GPL?
3. What is the relationship between UNIX and Linux?
4. What does CentOS stand for?
5. What does FSF stand for?
6. What is the relationship between Red Hat and Centos?
7. List some reasons to choose CentOS distro for studying Linux OS .
8. How can you choose your Linux distro ?
9. What are the differences between ext2, ext3 and ext4 filesystems?
10. What are the differences between xfs, vfat and swap?
11. Why choosing CentOS is sometimes better than Red Hat?
12. When choosing a Linux distro, what is the difference between community
version and enterprise version?
13. What is LVM?
14. Install VMware workstation 15 on your computer
15. Go to the CentOS website and download CentOS 7
16. Install CentOS 7 as virtual machine on VMware workstation 15
17. Create a new user account and change its password
18. How can you change the hostname of your Linux machine to studentHost ?
19. How can you configure manually the network settings?
20. What is the best Linux distro?

- 36 -
Linux Platform – I Chapter: 1

References
1. https://docs.centos.org/en-US/centos/install-guide
2. https://www.oreilly.com/library/view/running-linux-
third/156592469X/ch01s02.html
3. https://www.fsf.org/
4. https://lwn.net/Distributions/
5. http://www.centos.org/
6. https://www.journaldev.com/33762/top-best-linux-distros
7. https://www.redhat.com/en/topics/linux/fedora-vs-red-hat-enterprise-linux
8. https://www.liquidweb.com/kb/top-5-reasons-to-use-centos-7
9. https://wiki.centos.org/FAQ/General

- 37 -

You might also like