0% found this document useful (0 votes)
2 views37 pages

Linux Installation and Package Management

The document outlines the key aspects of Linux installation and package management, including designing a hard disk layout, installing boot managers like LILO and GRUB, and managing shared libraries. It discusses the importance of partitioning, backup strategies, and the use of package managers such as RPM and YUM for software management in Linux environments. Additionally, it covers Debian package management and tools like dpkg and apt-get for handling packages in Debian-based systems.

Uploaded by

hoangdeltavn03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views37 pages

Linux Installation and Package Management

The document outlines the key aspects of Linux installation and package management, including designing a hard disk layout, installing boot managers like LILO and GRUB, and managing shared libraries. It discusses the importance of partitioning, backup strategies, and the use of package managers such as RPM and YUM for software management in Linux environments. Additionally, it covers Debian package management and tools like dpkg and apt-get for handling packages in Debian-based systems.

Uploaded by

hoangdeltavn03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Linux Professional Institute 1 L I N U X I N S TA L L AT I O N A N D

PA C K A G E M A N A G E M E N T
Content

1. Linux Installation

2. Package Management

TEACH A COURSE 2
Objectives
➢Boot the SystemDesign a Hard Disk Layout
o System Considerations
o Swap Space
o General Guidelines
➢Install a Boot Manager
o LILO
o GRUB
o Manage Shared Libraries
o Shared Library Dependencies
o Linking Shared Libraries
➢Use Debian Package Management
o Debian Package Management Overview
o Managing Debian Packages
➢Use Red Hat Package Manager (RPM)
o RPM Overview
o Running rpm
o YUM Overview

LINUX PROFESSIONAL INSTITUTE 1 3


Design a Hard Disk Layout

➢Part of the installation process for Linux is designing the hard


disk partitioning scheme
➢System Considerations:
o The amount of disk space
o The size of the system
o What the system will be used for
o How and where backups will be performed

➢Limited disk space

LINUX PROFESSIONAL INSTITUTE 1 4


Design a Hard Disk Layout

➢Limited disk space:


oFilesystems and partitions holding user data should be maintained with a maximum amount
of free space to accommodate user activity
oWhen disk space is limited, you may opt to reduce the number of partitions, thereby
combining free space into a single contiguous pool
oExp: installing Linux on a PC with only 1 GB of available disk space might best be
implemented using only a few partitions:
- /boot : 50 MB. A small /boot filesystem in the first partition ensures that all kernels are
below the 1024-cylinder limit for older kernels and BIOS
- / : 850 MB. A large root partition holds everything on the system that’s not in /boot
- swap : 100MB

LINUX PROFESSIONAL INSTITUTE 1 5


Design a Hard Disk Layout
➢Larger systems:
oOn larger platforms, functional issues such as backup strategies and required filesystem sizes
can dictate disk layout
oFile server is to be constructed serving 100 GB of executable data files to end users via NFS

LINUX PROFESSIONAL INSTITUTE 1 6


Design a Hard Disk Layout

➢Mount points:
o Before you may access the various filesystem partitions created on the storage devices, you
first must list them in a filesystem table
o This process is referred to as mounting, and the directory you are mounting is called a
mount point
o You must create the directories that you will use for mount points if they do not already
exist
o During system startup, these directories and mount points may be managed through the
/etc/fstab file

LINUX PROFESSIONAL INSTITUTE 1 7


Design a Hard Disk Layout

➢Superblock:
o A superblock is a block on each filesystem that contains metadata information about
the filesystem layout
o The information contained in the block includes the type, size,and status of the
mounted filesystem
o The superblock is the Linux/Unix equivalent to Microsoft ‘ FAT table, which contains
the information about the blocks holding the top-level directory
o Since the information about the filesystems is important, Linux filesystems keep
redundant copies of the superblock that may be used to restore the filesystem
should it become corrupt

LINUX PROFESSIONAL INSTITUTE 1 8


Design a Hard Disk Layout

➢Master Boot Record (MBR):


o Very small program that contains information about your hard disk partitions and
loads the operating system.
o This program is located in the first sector of the hard disk and is 512 bytes.
o If this file becomes damaged, the operating system cannot boot
o Therefore, it is important to back up the MBR so that you can replace a damaged
copy if needed
o Example of such a backup command:

oTo restore:

LINUX PROFESSIONAL INSTITUTE 1 9


Design a Hard Disk Layout

➢Booting from a USB device:


o Linux may be booted from a Live USB, similar to booting from a Live CD.
o One difference between booting to the USB opposed to the CD is that the data on
the USB device may be modified and stored back onto the USB device.
o In order to boot from the USB device, you will need to:
- Make the USB device bootable: This requires setting up at least one partition on the USB
with the bootable flag set to the primary partition.
- An MBR must also write to the primary partition on the USB.
- There are many applications that can be used to create live USB distributions of Linux,
including Fedora Live USB Creator and Ubuntu Live USB Creator, ISO2USB for Redhat or
CentOS. …
- The computer may also need the BIOS to be configured to boot from USB.

LINUX PROFESSIONAL INSTITUTE 1 10


Design a Hard Disk Layout

➢System role:
o The role of the system should also dictate the optimal disk layout
o Exp: Unix-style network with NFS file servers, most of the workstations won’t necessarily
need all of their own executable files. So reduce size of /home partition

➢Backup:
o Using the dd command, you can back up each of the individual partitions. The command
may also be used to back up the entire hard drive.
o To back up a hard drive to another hard drive, you would issue the following command,
where if=/dev/hdx represents the hard drive you want to back up and of=/dev/hyd
represents the target or destination drive of the backup

LINUX PROFESSIONAL INSTITUTE 1 11


Design a Hard Disk Layout

➢Backup:
o Backup of the partition layout:

o Restore the partition table:

LINUX PROFESSIONAL INSTITUTE 1 12


Design a Hard Disk Layout

➢Swap Space (virtual memory):


o Used to temporarily store portions of main memory containing programs or program
data
o Size of the system’s swap space to be double the amount of physical RAM in the
machine.
o Exp: if your system has 512 MB of RAM, it would be reasonable to set your swap size
to at least 1 GB

LINUX PROFESSIONAL INSTITUTE 1 13


Design a Hard Disk Layout

➢General Guidelines:
o Keep the root filesystem (/) simple by distributing larger portions of the directory tree to other
partitions. A simplified root filesystem is less likely to be corrupted.
o Separate a small /boot partition below cylinder 1024 for installed kernels used by the system boot
loader.
o Separate /var : big enough to handle your logs, spools, and mail, taking their rotation and eventual
deletion into account.
o Separate /tmp: Its size depends on the demands of the applications you run.
o Separate /usr and make it big enough to accommodate kernel building. Making it standalone allows
you to share it read-only via NFS.
o Separate /home for machines with multiple users or any machine where you don’t want to affect
data during distribution software upgrades. For even better performance (for multiuser
environments), put /home on a disk array and use Logical Volume manager (LVM).
o Set swap space to at least the same size (twice the size is recommended) as the main memory.

LINUX PROFESSIONAL INSTITUTE 1 14


Install a Boot Manager

➢Boot Processing in Linux consists 2 basic phases:


o Run the boot loader from the boot device
- It is the boot manager’s job to find the selected kernel and get it loaded into memory, including any
user-supplied options.
o Launch the Linux kernel and start processes
- Your boot loader starts the specified kernel. The boot loader’s job at this point is complete and the
hardware is placed under the control of the running kernel, which sets up shop and begins running
processes.

➢Boot Loader:
o LILO (Linux Loader)
o Grub (GRand Unified Bootloader)

TEACH A COURSE 15
Install a Boot Manager

➢LILO
oThe LILO is a small utility designed to load the Linux kernel into memory and start it
oConsists of two parts:
- The boot loader:
- The lilo command: used to install and configure
- the LILO boot loader

TEACH A COURSE 16
Install a Boot Manager

➢Grub
oGRUB is a multistage boot loader, much like LILO.
oMore flexible than LILO, as it includes support for booting arbitrary kernels on various
filesystem types and for booting several different operating systems.

TEACH A COURSE 17
Manage Shared Libraries
➢When a program is compiled under Linux, many of the functions
required by the program are linked from system libraries that handle
disks, memory, and other functions.
➢Exp: when the standard C-language printf() function is used in a
program, the programmer doesn’t provide the printf() source code, but
instead expects that the system already has a library containing such
functions
➢Link Type:
◦ Statically linked:
◦ Stands alone, requiring no additional code at runtime
◦ Wasted memory when many different programs running concurrently contain the same library functions
◦ Dynamically linked
◦ Allows multiple programs to use the same library code in memory
◦ Dynamically linked libraries are shared among many applications and are thus called shared libraries

TEACH A COURSE 18
Manage Shared Libraries

➢Shared Library Dependencies


◦ Ldd command: Display shared libraries required by each of the programs

TEACH A COURSE 19
Use Red Hat Package Manager (RPM)

➢The Red Hat Package Manager is among the most popular methods for the
distribution of software for Linux and is installed by default on most
distributions.
➢RPM automates the installation and maintenance of software packages
➢Built into each package are program files, configuration files,
documentation, and dependencies on other packages
➢RPM packages have four common elements:
o Name
o Version
o Revision
o Architecture

LINUX PROFESSIONAL INSTITUTE 1 20


Use Red Hat Package Manager (RPM)

➢RPM Command:
- Provides for the installation, removal, upgrade, verification, and other management of RPM
packages

LINUX PROFESSIONAL INSTITUTE 1 21


Use Red Hat Package Manager (RPM)

➢RPM Command:

LINUX PROFESSIONAL INSTITUTE 1 22


Use Red Hat Package Manager (RPM)

➢RPM Command:
- Install/upgrade mode

LINUX PROFESSIONAL INSTITUTE 1 23


Use Red Hat Package Manager (RPM)

➢RPM Command:
oUninstall mode

LINUX PROFESSIONAL INSTITUTE 1 24


Use Red Hat Package Manager (RPM)

➢RPM Command:
oQuery mode
- Installed packages and raw package files can be queried using the rpm -q command

LINUX PROFESSIONAL INSTITUTE 1 25


Use Red Hat Package Manager (RPM)

➢RPM Command:
oQuery mode

LINUX PROFESSIONAL INSTITUTE 1 26


Use Red Hat Package Manager (RPM)

➢RPM Command:
o Query mode

LINUX PROFESSIONAL INSTITUTE 1 27


Use Red Hat Package Manager (RPM)

➢RPM Command:
o Query mode

LINUX PROFESSIONAL INSTITUTE 1 28


Use Red Hat Package Manager (RPM)

➢RPM Command:
◦ Verify mode
◦ Files from installed packages can be compared against their expected configuration from the RPM database by using rpm -V.

LINUX PROFESSIONAL INSTITUTE 1 29


YUM Overview

➢YUM (Yellowdog Updater Modified) is a package manager


offering a fast way for installing, updating, and removing
packages
➢The yum command has a very simple interface and functions
similar to rpm
➢ yum additionally manages all of the dependencies for you
➢Yum has the ability to support multiple repositories for packages
➢YUM is configured through the /etc/yum.conf configuration file.

LINUX PROFESSIONAL INSTITUTE 1 30


YUM Overview

LINUX PROFESSIONAL INSTITUTE 1 31


YUM Overview

➢You can also check to see if a particular package is installed or


available for install using the list command

LINUX PROFESSIONAL INSTITUTE 1 32


YUM Overview

LINUX PROFESSIONAL INSTITUTE 1 33


YUM Overview

LINUX PROFESSIONAL INSTITUTE 1 34


Use Debian Package Management

➢Debian Package Management Overview


◦ Each Debian package contains program and configuration files, documentation, and noted
dependencies on other packages
◦ The names of Debian packages have three common elements, including:

◦ Package name
◦ Version number
◦ File extension

LINUX PROFESSIONAL INSTITUTE 1 35


Use Debian Package Management

➢Managing Debian Packages


oThe original Debian package management tool is dpkg
oThe alternative apt-get (Advanced Package Tool) tool operates using package names,
obtaining them from a predefined source (such as CD-ROMs, FTP sites, etc.)
oThe dselect command offers an interactive menu that allows the administrator to select
from a list of available packages and mark them for subsequent installation
oalian: Convert to or install a non-Debian (or “alien”) package as rpm…

LINUX PROFESSIONAL INSTITUTE 1 36


Thank You!
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere,
magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy