(DevOps) Lecture - Linux - Part 1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 124

Special Topics in CS (DevOps)

Introduction to Linux Operating


System and Virtualization
Learning Objectives
• Introduction to Linux
• Linux Kernel
• Introduction to Virtualization
• Virtual Machines
• Hypervisors
• OS installation on Virtual Machine
• Ubuntu Graphical User Interface (GUI)
First of multitasking, a multiuser operating system

Development started in 1969 by AT&T at Bell Labs research center by Ken Thompson
and Dennis Ritchie.
Development stared in 1969 by AT&T at Bell Labs research center by Ken Thompson
and Dennis Ritchie.

First of multitasking, multiuser operating system.


Linus Torvalds Free Software Foundation

Linux was created in the early 1990s by Finnish software engineer


Linus Torvalds and the Free Software Foundation (FSF). Linus
started developing Linux to create a system similar to MINIX, a
UNIX like Operating System.
• Modern, free operating system based on UNIX
• the self-contained kernel in 1991
• Unix Compatibility
• many users around the world are its collaborators
• runs efficiently and reliably on common PC hardware
• runs on other platforms like raspberry pi, IoT devices
Series of widely used free software licenses that guarantee end-users
the four freedoms to: run, study, share and modify the software
GNU General Public License (GNU GPL)

Series of widely used free software licenses that guarantee end-users


the four freedoms to: run, study, share and modify the software
Linux Distributions

and 1200+ more


Major Linux Distributions
• RedHat Enterprise Linux: https://www.redhat.com/
• Debian: https://www.debian.org/
• Ubuntu: https://ubuntu.com/
• Fedora Core: https://getfedora.org/
• CentOS: https://www.centos.org/
• Kali Linux: https://www.kali.org/
Major Linux Distributions
• RedHat Enterprise Linux: PC, server, hypervisors, cloud
• Debian: laptops, PC, servers
• Ubuntu: laptops, PC, servers, hypervisors, cloud, IoT
• Fedora Core: laptops, PC, servers
• CentOS: servers, cloud, hypervisor
• Kali Linux: Penetration testing, laptop, pc
Kernel
• The main layer between the OS and
hardware.
• Helps with process and memory
management, file systems, device control,
and networking.
Linux Kernel
• Version 0.01 (May 1991) had no networking, ran only on 80386-compatible
Intel processors and on PC hardware, had extremely limited device-drive
support, and supported only the Minix file system
• Linux 1.0 (March 1994) included these new features:
• Support for UNIX’s standard TCP/IP networking protocols
• BSD-compatible socket interface for networking programming
• Device-driver support for running IP over an Ethernet
Linux Kernel
• Enhanced file system
• Support for a range of SCSI controllers for
• high-performance disk access
• Extra hardware support
• Version 1.2 (March 1995) was the final PC-only Linux kernel
• Kernels with odd version numbers are development kernels, those with even
numbers are production kernels
Linux Kernel
• Released in June 1996, 2.0 added two major new capabilities:
• Support for multiple architectures, including a fully 64-bit native Alpha port
• Support for multiprocessor architectures
• Other new features included:
• Improved memory-management code
• Improved TCP/IP performance
• Support for internal kernel threads, for handling dependencies between
loadable modules, and for automatic loading of modules on demand
Linux Kernel
• Standardized configuration interface
• Available for Motorola 68000-series processors, Sun Sparc systems, and for
PC and PowerMac systems
• 2.4 and 2.6 increased SMP support, added journaling file system, preemptive
kernel, 64-bit memory support
• 3.0 released in 2011, the 20th anniversary of Linux, improved virtualization
support, a new page write-back facility, improved memory management, new
Completely Fair Scheduler
Understanding Kernel Versions
Understanding Kernel Versions
Download Linux Kernel

• https://kernel.org
Virtualization

• Creation of a virtual version of something


• Simulates hardware functionality to create a virtual system
Virtual Machine

• Virtualization/emulation of a computer system


• Based on computer architectures
• Provide functionality of a physical computer
• implementations may involve specialized hardware, software, or a
combination.
System Virtual Machine

• Provide a substitute for a real machine


Process Virtual Machine

• Designed to execute computer programs in a platform-independent


environment.
Hypervisor
• Software that creates and runs a virtual machine
Type 1 Hypervisor
• runs directly on the underlying computer's physical hardware,
interacting directly with its CPU, memory, and physical storage
Type 2 Hypervisor
• virtual machine (VM) manager that is installed as a software
application on an existing operating system (OS)
Type 1 vs Type 2 Hypervisors
• Type 1 runs on bare metal and Type 2 runs on top of an operating
system.
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Installing Ubuntu Desktop 20.04 Ubuntu
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Ubuntu Linux Installation
• Graphical User Interface
Summary
• Introduction to Linux (Ubuntu)
• Linux Kernel
• Introduction to Virtualization
• Virtual Machines
• Hypervisors
• OS installation on Virtual Machine
• Ubuntu Graphical User Interface (GUI)
Special Topics in CS (DevOps)
Linux Directory Structure and Basic Commands
Learning Objectives

• Introduction to Command Line Interface (CLI)


• Linux Directory Structure
• Linux Basic Commands
Command Line Interface
• Terminal for your computer
• Enable users to interact with the operating system
• Takes in commands, and passes them on to the computer's operating system
• Output shows the reply from the operating system
Linux Directory Structure
Directory Description
/ "root" Primary hierarchy for entire file system
/bin Essential command binaries must be available in the single-user
mode for all users. e.g cat, ls
/boot boot loader files, e.g kernels, initrd

/dev device files, e.g /dev/sda

/etc Editable text configuration or Extended tool chest


Linux Directory Structure
Directory Description
/etc/opt Configuration files for add-on packages stored in /opt
Users' home directories, containing personal files, personal settings
/home etc.
/lib Essential libraries for binaries in /bin and /sbin

/media mount point for removable media such as usb

/mnt Temporarily mounted filesystems


Linux Directory Structure
Directory Description
/opt Optional application software packages

/proc Virtual fs providing process and kernel as files

/root Home directory for root user

/run runtime variable data, currently logged-in users, running daemons


etc.
/sbin Essential system binaries e.g fsck, init, route
Linux Directory Structure
Directory Description
information about devices, drivers, and some kernel features
/sys

/tmp Temporary files, not preserved between reboot, severely size


restricted
/usr secondary hierarchy for read-only user data, majority of user
utilities and applications
/usr/bin Non-essential command binaries, for all users

/usr/include Standard include files


Linux Directory Structure
Directory Description
/usr/lib libraries for binaries in /usr/bin and /usr/sbin

/usr/local Tertiary hierarchy for local data, specific to this host

/usr/sbin non-essential system binaries

/usr/share Architecture independent data

/var Variable Files


Linux Directory Structure
Directory Description
/var/lock Lock files. keeping track of resources currently in use

/var/tmp temporary files to be preserved between reboots


State information. Persistent data modified by programs as they
/var/lib run e.g databases
/var/log Log Files, Various logs

/var/run Runtime variable data


Linux Basic Commands
• pwd: present working directory.
Linux Basic Commands
• ls: list the files in a directory.
Linux Basic Commands
• mkdir: make directory.
Linux Basic Commands
• cd: to change directory, us 'cd' command
Linux Basic Commands
• touch: Update the last-modified date on the given FILEs.
commonly used for creating a new empty file.
Linux Basic Commands
• vi: screen-oriented text editor.
Linux Basic Commands
• nano: text editor.
Linux Basic Commands
• echo: display line of text/string.
Linux Basic Commands
• echo: write a line into a file using echo, write the command as
text > filename
Linux Basic Commands
• cat: Concatenate files and print on the standard output.
Linux Basic Commands
• cat:
⚬ replace the content of a file with another file's content
■ (source > dest)
⚬ append the content of a file in another file
■ (source >> dest)
Linux Basic Commands
• head: output start of a file.
Linux Basic Commands
• tail: output end of a file.
Linux Basic Commands
• grep: search for a string of characters in a specified file.
Linux Basic Commands
• rm: removes each file specified.
Linux Basic Commands
• cp: copying files and directories to another location.
Linux Basic Commands
• mv: move file or directory from one place to another.
Linux Basic Commands
• locate: will print the absolute path of all files and directories.
Linux Basic Commands
• env: print a list of the current environment variables.
Linux Basic Commands
• rmdir: Remove the DIRECTORY, if it is empty.
Linux Basic Commands
• whoami: Print the current user name.
Linux Basic Commands
• find: Search for files in a directory hierarchy
Linux Basic Commands
• sleep : Delay for a specified amount of time
Linux Basic Commands
• dd : Copy a file, converting and formatting.
Linux Basic Commands
• ping: Send ICMP ECHO_REQUEST to network hosts
Linux Basic Commands
• wget: Retrieve files via HTTP or FTP
Linux Basic Commands
• hostname: Get or set hostname or DNS domain name
Linux Basic Commands
• man: interface to the on-line reference manuals
Summary
• Introduction to Command Line Interface (CLI)
• Linux Directory Structure
• Linux Basic Commands
Special Topics in CS (DevOps)
Package Manager and Software Installation in
Ubuntu
Learning Objectives

• Package Manager
• Public Repositories
• Software installation using package manager
Package Manager
• A collection of software tools that automates the process of installing,
upgrading, configuring, and removing computer programs for a computer in a
consistent manner.

• A package manager deals with packages, distributions of software and data in


archive files
Package Manager
Package Managers
• apt: Advanced Package Tool (Ubuntu, Debian)

• yum: Yellowdog Updater, Modified (CentOS)

• rpm: Red Hat Package Manager (RehHat)

• homebrew: package manager for MacOS


Package Manager
• apt: Advanced package tool.
Package Manager
• Yum: primary tool for getting, installing, deleting, querying, and
otherwise managing Red Hat Enterprise Linux RPM software packages
from official Red Hat software repositories.
Package Manager
• dpkg: Install, remove and manage Debian packages.
Package Manager
• brew: free macOS package manager that allows you to install, update, or
remove software by running commands in the terminal.
Advanced Package Tool
• apt-get vs apt

⚬ apt-get
■ apt-get is lower-level and "back-end", and supports other
APT-based tools.

⚬ apt
■ apt is designed for end-users (humans) and its output may
be changed between versions
Repository
• collection of deb packages with metadata that is readable by the apt
family
• In Debian or Ubuntu, the software repositories are defined in
/etc/apt/sources.list
• Third-party repositories can be added in Ubuntu, add its link to the
file mentioned above
• Personal Package Archives (PPAs) are software repositories
designed for Ubuntu users and are easier to install than other third-
party repositories
• PPAs are often used to distribute pre-release software so that it can
be tested.
Software Listing
• apt list
Software Search
• apt search [package name. apache2}
Software Update
• apt update.
Software Upgrade
• apt upgrade.
Software Install
• apt install {package name. vlc}
Software Details
• apt show {package name. vlc}
Software Reinstallation
• apt reinstall [package-name. skype]
Software Deletion
• apt remove [package-name.vlc]
Software Deletion
(With all dependencies removed)

• apt purge [package-name.vlc]


All Unnecessary Softwares Deletion
• apt autoremove.
GUI Installation
• Ubuntu Software
GUI Installation
• Ubuntu Software Interface
GUI Installation
• Search a software
GUI Installation
• Search a software
GUI Installation
• Click on the software to see its details
GUI Installation
• Click install button to install the package
GUI Installation
• package installing
GUI Installation
• status after installation of the pakcage
GUI Installation
• Click remove button to delete the package
GUI Installation
• Click remove button to delete the package

You might also like