Linux Installation and Package Management
Linux Installation and Package Management
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
➢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
➢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
oTo restore:
➢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
➢Backup:
o Backup of the partition 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.
➢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
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
➢RPM Command:
- Provides for the installation, removal, upgrade, verification, and other management of RPM
packages
➢RPM Command:
➢RPM Command:
- Install/upgrade mode
➢RPM Command:
oUninstall mode
➢RPM Command:
oQuery mode
- Installed packages and raw package files can be queried using the rpm -q command
➢RPM Command:
oQuery mode
➢RPM Command:
o Query mode
➢RPM Command:
o Query mode
➢RPM Command:
◦ Verify mode
◦ Files from installed packages can be compared against their expected configuration from the RPM database by using rpm -V.
◦ Package name
◦ Version number
◦ File extension