SlideShare a Scribd company logo
1 of 29
LINUX SYSTEM
ADMINISTRATION
CHAPTER 4. MANAGING SOFTWARE
MR. JAYANT. PRADEEP. DALVI
INTRODUCTION
• Managing Red Hat software requires RPMs, the basic package format
that is used for software installation with details of how software is
organized in repositories and how yum is used to manage software
from these repositories.
• A Linux repository is a storage location from which your system
retrieves and installs OS updates and applications. Each repository is a
collection of software hosted on a remote server and intended to be
used for installing and updating software packages on Linux systems
Understanding RPM
• In the early days of Linux, the “tar ball” was the default method for installing
software.
• A tar ball is an archive that contains files that need to be installed.
Unfortunately, there were no rules for exactly what needed to be in the tar
ball; neither were there any specifications of how the software in the tar ball
was to be installed.
• Working with tar balls was inconvenient for several reasons.
1. There was no standardization.
2. When using tar balls, there was no way to track what was installed.
3. Updating and de-installing tar balls was difficult to do.
• In some cases, the tar ball contained source files that still needed to be
compiled. In other cases, the tar ball had a nice installation script. In other
situations still, the tar ball would just include a bunch of files including a
README file explaining what to do with the software.
• The ability to trace software was needed to overcome the disadvantages of
tar balls. The Red Hat Package Manager (RPM) is one of the standards
designed to fulfill this need.
• An RPM is basically an archive file. It is created with the cpio command. With
RPM, there is also metadata describing what is in the package and where
those different files should be installed.
• Because RPM is so well organized, it is easy for an administrator to query
exactly what is happening in it.
• Another benefit of using RPM is that its database is created in the
/var/lib/rpm directory.
• This database keeps track of the exact version of files that are
installed on the computer.
• Thus, for an administrator, it is possible to query individual RPM files
to see their contents. You can also query the database to see where a
specific file comes from or what exactly is in the RPM.
Understanding Meta Package Handlers
• Even though RPM is a great step forward in managing software, there
is still one inconvenience that must be dealt with—software
dependency.
• To standardize software, many programs used on Linux use libraries
and other common components provided by other software
packages.
• That means to install package A, package B is required to be present.
This way of dealing with software is known as a software
dependency.
• Imagine an administrator who wants to install a given package downloaded from
the Internet. It’s possible that in order to install this package, the administrator
would first have to install several other packages. This would be indicated by the
infamous “Failed dependencies” message.
• Sometimes the situation become worse that a real dependency hell can occur
where, after downloading all of the missing dependencies, each of the
downloaded packages would have its own set of dependencies.
• The solution for dependency hell is the Meta Package Handler, which in Red Hat is
known as yum (Yellowdog Update Manager), works with repositories, which are
the installation sources that are consulted whenever a user wants to install a
software package.
• In the repositories, all software packages of your distribution are typically
available.
• While installing a software package using yum install somepackage, yum first
checks to see whether there are any dependencies.
• If there are, yum checks the repositories to see whether the required software
is available in the repositories, and if it is, the administrator will see a list of
software that yum wants to install as the required dependencies.
• If you installed Red Hat Enterprise Linux with a valid registration key, the
installation process sets up repositories at the Red Hat Network (RHN) server
automatically for you.
• With these repositories, you’ll always be sure that you’re using the latest
version of the RPM available. If you installed a test system that cannot
connect to RHN, you need to create your own repositories
Creating Your Own Repositories
If you have a Red Hat server installed that doesn’t have access to the
official RHN repositories, you’ll need to set up your own repositories.
This procedure is also useful if you want to copy all of your RPMs to a
directory and use that directory as a repository.
Setting Up Your Own Repository
• First copy all of the RPM files from the Red Hat installation DVD to a
directory that you’ll create on disk.
• Next install and run the createrepo package and its dependencies. This
package is used to create the metadata that yum uses while installing the
• software packages.
• While installing the createrepo package, you’ll see that some dependency
problems have to be handled as well.
1. Use mkdir /repo to create a directory that you can use as a repository in the
root of your server’s fi le system.
2. Insert the Red Hat installation DVD in the optical drive of your server.
Assuming that you run the server in graphical mode, the DVD will be
mounted automatically.
3. Use the cd /media/RHEL[Tab] command to go into the mounted DVD. Next use cd
Packages, which brings you to the directory where all RPMs are by default. Now use
cp * /repo to copy all of them to the /repo directory you just created. Once this is
finished, you don’t need the DVD anymore.
4. Now use cd /repo to go to the /repo directory. From this directory, type rpm -ivh
createrepo[Tab]. This doesn’t work, and it gives you a “ Failed dependencies” error.
To install createrepo, you first need to install the deltarpm and python-deltarpm
packages. Use rpm -ivh deltarpm[Tab] python-deltarpm[Tab] to install both of
them. Next, use rpm -ivh createrepo[Tab] again to install the createrepo package.
5. Once the createrepo package has been installed, use createrepo /repo, which
creates the metadata that allows you to use the /repo directory as a repository.
This will take a few minutes. When this procedure is finished, your repository is ready
for use.
Managing Repositories
• In the preceding section, we learned how to turn a directory that
contains RPMs into a repository. However, just marking a directory as
a repository isn’t enough.
• To use your newly created repository, you’ll have to tell your server
where it can find it. To do this, you need to create a repository file in
the directory /etc/yum.repos.d.
• You’ll probably already have some repository files in this directory.
• In the sample file in Listing 4.3, you will find all elements that a repository file
should contain.
• First, between square brackets there is an identifier for the repository. It
allows you to recognize the repository easily later, and it’s used on your
computer only and name parameter gives a name to the repository.
• The important parameter is baseurl which tells where the repository can be
found in URL format. As you can see in this example, an FTP server at Red Hat
is specified.
• Alternatively, you can also use URLs that refer to a website or to a directory
that is local on your server’s hard drive.
• The file:// part is the URI, which tells yum that it has to look at a file, and after
that, you need a complete path to the file or directory, which in this case is
/yourrepository
• Next the parameter enabled specifies whether this repository is enabled. A 0 indicates that
it is not, and if you really want to use this repository, this parameter should have 1 as its
value.
• The last part of the repository specifies if a GPG file is available. Because RPM packages
are installed as root and can contain scripts that will be executed as root without any
warning. GPG helps in guaranteeing the integrity of software packages you are installing.
• To check whether packages have been tampered with, a GPG check is done on each
package that you’ll install. To do this check, you need the GPG files installed locally on your
computer. As you can see, some GPG files that are used by Red Hat are installed on your
computer by default. Their location is specified using the gpgkey option.
• Next the option gpgcheck=1 tells yum that it has to perform the GPG integrity check. If
you’re having a hard time configuring the GPG check, you can change this parameter to
gpgcheck=0, which completely disables the GPG check for RPMs that are found in this
repository.
Installing Software with Yum
After configuring the repositories, you can install, query, update, and
remove software with the meta package handler yum. This tool is easy to
understand and intuitive.
Searching Packages with Yum
• To manage software with yum, the first step is often to search for the
software you’re seeking.
• The command yum search will do this for you. If you’re looking for a
package with the name nmap, for example, use yum search nmap. Yum will
come back with a list of all packages that match the search string, but it
looks for it only in the package name and summary. Otherwise you can
try yum search all, which will also look in the package description.
• If you are looking for the name of a specific file, use yum provides or its
equivalent, yum whatprovides command also checks the repository metadata for
files that are in a package, and it tells you exactly which package you need to find
a specific file.
• You have to specify it as */nameofthefile. For example, the following
command searches in yum for the package that contains the file zcat: yum provides
*/zcat.
• Sometimes it takes a while to search for packages with yum because it works
with indexes that it has to download and update periodically from the
repositories.
• Once these indexes are downloaded, yum will work a bit faster.
• You can force yum to clear everything it has cached and download new index
files by using yum clean all.
Installing and Updating Packages
• Once you’ve found the package you were seeking, you can install it using
yum install.
• For instance, if you want to install the network analysis tool nmap, after
verifying that the name of the package is indeed nmap, use yum install nmap
to install the tool.
• Yum will then check the repositories to find out where it can find the most
recent version of the program you’re seeking, and after finding it, yum
shows you what it wants to install.
• If there are no dependencies, it will show just one package. However, if
there are dependencies, it displays a list of all the packages it needs to
install in order to give you what you want.
• Next, type Y to confirm that you really want to install what yum has
proposed, and the software will be installed
• There are two useful options when working with yum install. The first option, -y,
can be used to automate things a bit. If you don’t use it, yum will first display a
summary of what it wants to install. Next it will prompt you to confirm, after
which it will start the installation. Use yum install -y to proceed immediately,
without any additional prompts for confirmation.
• Another useful yum option is --nogpgcheck. If you don’t want to perform a GPG
check to install a package, just add --nogpgcheck to your yum install command.
For instance, use yum install -y --nogpgcheck xinetd if you want to install the xinetd
package without performing a GPG check and without having to confirm the
installation.
• In some cases, you may need to install an individual software package
that is not in a repository but that you’ve downloaded as an RPM
package.
• To install such packages, you could use the command rpm -ivh
packagename.rpm. However, this command doesn’t update the yum
database, and therefore it’s not a good idea to install packages using
the rpm command. Use yum localinstall instead. This will update the
yum database and also check the repositories to try to fix all potential
dependency problems automatically, like you are used to when using
yum install.
• If a package has already been installed, you can use yum update to update
it. Use this command with the name of the specific package you want to
update, or just use yum update to check all repositories and find out
whether more recent versions of the packages you’re updating are
available.
• Normally, updating a package will remove the older version of a package,
replacing it completely with the latest version. An exception occurs when
you want to update the kernel.
• The command yum update kernel will install the newer version of the
kernel, while keeping the older version on your server.
• It is useful because it allows you to boot the old kernel in case the new
kernel is giving you problems
Removing Packages
• As is the case for installing packages, removing is also easy to do with
yum. Just use yum remove followed by the name of the package you
want to uninstall.
• For instance, to remove the package nmap, use yum remove nmap. The
yum remove command will first provide an overview of what exactly it
intends to do.
• In this overview, it will display the name of the package it intends to
remove and all packages that depend on this package.
• It is very important that you read carefully what yum intends to do. If
the package you want to remove has many dependencies, by default
yum will remove these dependencies as well. In some cases, it is not a
good idea to proceed with the default setting.
Working with Package Groups
• To simplify installing software, yum works with the concept of package
groups. In a package group, you will find all software that relates to specific
functionality, as in the package group Virtualization, which contains all
packages that are used to implement a virtualization solution on your server.
• To get more information about the packages in a yum group, use the yum
groupinfo command. For instance, yum groupinfo Virtualization displays a list of all
packages within this group.
• Next use yum groupinstall Virtualization to install all packages in the group.
Command and its Use:
1. yum search: Search for a package based on its name or a word in the package
summary.
2. yum provides */filename: Search in yum packages to find the package that contains a
filename.
3. yum install: Install packages from the repositories.
4. yum update [packagename]: Update all packages on your server or a specific one, if
you include a package name.
5. yum localinstall: Install a package that is not in the repositories but available as an RPM
file.
6. yum remove: Remove a package.
7. yum list installed: Provide a list of all packages that are installed. This is useful in
combination with grep or to check whether a specific package has been installed.
8. yum grouplist: Provide a list of all yum package groups.
9. yum groupinstall: Install all packages in a package group.
Querying Software
• Querying software helps you in a generic way to get more information about
software installed on your computer. Querying RPM packages also helps you fix
specific problems with packages.
• There are many ways to query software packages. There are two ways to
perform a query. You can query packages that are currently installed on your
system, and it’s also possible to install package files that haven’t yet been
installed.
• To query an installed package, you can use one of the rpm -q options. To get
information about a package that hasn’t yet been installed, you need to add the
-p option.
• A very common way to query RPM packages is by using rpm -qa. This command
generates a list of all RPM packages that are installed on your server and thus
provides a useful means for finding out whether some software has been
installed.
• A useful modification to rpm -qa is the -V option, which shows you if a package
has been modified from its original version.
• Using rpm -qVa thus allows you to perform a basic integrity check on the
software you have on your server. Every file that is shown in the output of this
command has been modified since it was originally installed.
• The different query options that allow you to obtain information about
installed packages, or about packages you are about to install, is also very
useful.
•Query options for installed packages
Query command and Result:
1. rpm -ql packagename- Lists all files in package name
2. rpm -qc packagename- Lists all configuration files in package name
3. rpm -qd packagename -Lists all documentation files in package name.
• A particularly useful query option is the --scripts option.
• Use rpm -q --scripts packagename to apply this option. This option is useful
because it shows the scripts that are executed when a package is
installed.
• There is one more useful query option: rpm -qf. You can use this option to
find out from which file a package originated.
Extracting Files from RPM Packages
• Software installed on your computer may become damaged. If this
happens, then you can extract files from the packages and copy them
to the original location of the file.
• Every RPM package consists of two parts: the metadata part that
describes what is in the package and a cpio archive that contains the
actual files in the package.
• If a file has been damaged, you can start with the rpm -qf query option
to find out from what package the file originated.
• Next use rpm2cpio | cpio -idmv to extract the files from the package to a
temporary location
UNIVERSITY QUESTIONS
1. How to set up your own repository?
2. Explain installing and updating packages with yum.
3. Write a note on RPM and YUM in Linux.
4. Write steps to create and manage repositories.

More Related Content

What's hot

Deployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxDeployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxWO Community
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutSander Temme
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsBrendan Gregg
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Amin Astaneh
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Elvin Gentiles
 
Installing php and my sql locally using xampp
Installing php and my sql locally using xamppInstalling php and my sql locally using xampp
Installing php and my sql locally using xampppeyman Ghader Kurehpaz
 
Managing Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewManaging Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewBaden Hughes
 
Overview of FreeBSD PMC Tools
Overview of FreeBSD PMC ToolsOverview of FreeBSD PMC Tools
Overview of FreeBSD PMC ToolsACMBangalore
 
1. Scaling PHP/MySQL...Presentation from Flickr
	
1.	
Scaling PHP/MySQL...Presentation from Flickr	
1.	
Scaling PHP/MySQL...Presentation from Flickr
1. Scaling PHP/MySQL...Presentation from Flickrakshat
 
Alfresco Security Best Practices 2012
Alfresco Security Best Practices 2012Alfresco Security Best Practices 2012
Alfresco Security Best Practices 2012Toni de la Fuente
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: IntroductionBrendan Gregg
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at NetflixBrendan Gregg
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsBrendan Gregg
 
Iptablesrocks
IptablesrocksIptablesrocks
Iptablesrocksqwer_asdf
 

What's hot (20)

Terraform day1
Terraform day1Terraform day1
Terraform day1
 
Deployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS LinuxDeployment of WebObjects applications on CentOS Linux
Deployment of WebObjects applications on CentOS Linux
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Perl in Teh Cloud
Perl in Teh CloudPerl in Teh Cloud
Perl in Teh Cloud
 
Debian packaging
Debian packagingDebian packaging
Debian packaging
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
Smash the Stack: Writing a Buffer Overflow Exploit (Win32)
 
Nrpe
NrpeNrpe
Nrpe
 
Installing php and my sql locally using xampp
Installing php and my sql locally using xamppInstalling php and my sql locally using xampp
Installing php and my sql locally using xampp
 
Managing Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's ViewManaging Perl Installations: A SysAdmin's View
Managing Perl Installations: A SysAdmin's View
 
Overview of FreeBSD PMC Tools
Overview of FreeBSD PMC ToolsOverview of FreeBSD PMC Tools
Overview of FreeBSD PMC Tools
 
1. Scaling PHP/MySQL...Presentation from Flickr
	
1.	
Scaling PHP/MySQL...Presentation from Flickr	
1.	
Scaling PHP/MySQL...Presentation from Flickr
1. Scaling PHP/MySQL...Presentation from Flickr
 
Alfresco Security Best Practices 2012
Alfresco Security Best Practices 2012Alfresco Security Best Practices 2012
Alfresco Security Best Practices 2012
 
DTrace Topics: Introduction
DTrace Topics: IntroductionDTrace Topics: Introduction
DTrace Topics: Introduction
 
Linux Profiling at Netflix
Linux Profiling at NetflixLinux Profiling at Netflix
Linux Profiling at Netflix
 
Linux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old SecretsLinux Performance Analysis: New Tools and Old Secrets
Linux Performance Analysis: New Tools and Old Secrets
 
Final terraform
Final terraformFinal terraform
Final terraform
 
Iptablesrocks
IptablesrocksIptablesrocks
Iptablesrocks
 

Similar to Linux System Administration

Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Ahmed El-Arabawy
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015ice799
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linuxnejadmand
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015ice799
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Chef
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chefice799
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wikishahab071
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryAneesa Rahman
 
2.5 use rpm and yum package management
2.5 use rpm and yum package management2.5 use rpm and yum package management
2.5 use rpm and yum package managementAcácio Oliveira
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package managementAcácio Oliveira
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package managementAcácio Oliveira
 

Similar to Linux System Administration (20)

Linux16 RPM
Linux16 RPMLinux16 RPM
Linux16 RPM
 
Linux16 RPM
Linux16 RPMLinux16 RPM
Linux16 RPM
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
6 - Package Management in Red Hat
6 - Package Management in Red Hat6 - Package Management in Red Hat
6 - Package Management in Red Hat
 
Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
 
Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
Software management in linux
Software management in linuxSoftware management in linux
Software management in linux
 
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
RPM (LINUX)
RPM (LINUX)RPM (LINUX)
RPM (LINUX)
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chef
 
How tos nagios - centos wiki
How tos nagios - centos wikiHow tos nagios - centos wiki
How tos nagios - centos wiki
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & Recovery
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
2.5 use rpm and yum package management
2.5 use rpm and yum package management2.5 use rpm and yum package management
2.5 use rpm and yum package management
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 
101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management101 2.5 use rpm and yum package management
101 2.5 use rpm and yum package management
 

More from Jayant Dalvi

Linux System Administration
Linux System AdministrationLinux System Administration
Linux System AdministrationJayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Information system audit 2
Information system audit 2 Information system audit 2
Information system audit 2 Jayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
java- Abstract Window toolkit
java- Abstract Window toolkitjava- Abstract Window toolkit
java- Abstract Window toolkitJayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Information system audit
Information system audit Information system audit
Information system audit Jayant Dalvi
 
Information system audit
Information system audit Information system audit
Information system audit Jayant Dalvi
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design Jayant Dalvi
 
Information system audit
Information system audit Information system audit
Information system audit Jayant Dalvi
 
Multithreading in Java
Multithreading in JavaMultithreading in Java
Multithreading in JavaJayant Dalvi
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++Jayant Dalvi
 
Object Oriented Programming using C++
Object Oriented Programming using C++Object Oriented Programming using C++
Object Oriented Programming using C++Jayant Dalvi
 

More from Jayant Dalvi (16)

Linux System Administration
Linux System AdministrationLinux System Administration
Linux System Administration
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Java I/O
Java I/OJava I/O
Java I/O
 
Information system audit 2
Information system audit 2 Information system audit 2
Information system audit 2
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
java- Abstract Window toolkit
java- Abstract Window toolkitjava- Abstract Window toolkit
java- Abstract Window toolkit
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Information system audit
Information system audit Information system audit
Information system audit
 
Information system audit
Information system audit Information system audit
Information system audit
 
Structured system analysis and design
Structured system analysis and design Structured system analysis and design
Structured system analysis and design
 
Information system audit
Information system audit Information system audit
Information system audit
 
Multithreading in Java
Multithreading in JavaMultithreading in Java
Multithreading in Java
 
Exception handling c++
Exception handling c++Exception handling c++
Exception handling c++
 
Object Oriented Programming using C++
Object Oriented Programming using C++Object Oriented Programming using C++
Object Oriented Programming using C++
 

Recently uploaded

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 

Recently uploaded (20)

Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 

Linux System Administration

  • 1. LINUX SYSTEM ADMINISTRATION CHAPTER 4. MANAGING SOFTWARE MR. JAYANT. PRADEEP. DALVI
  • 2. INTRODUCTION • Managing Red Hat software requires RPMs, the basic package format that is used for software installation with details of how software is organized in repositories and how yum is used to manage software from these repositories. • A Linux repository is a storage location from which your system retrieves and installs OS updates and applications. Each repository is a collection of software hosted on a remote server and intended to be used for installing and updating software packages on Linux systems
  • 3. Understanding RPM • In the early days of Linux, the “tar ball” was the default method for installing software. • A tar ball is an archive that contains files that need to be installed. Unfortunately, there were no rules for exactly what needed to be in the tar ball; neither were there any specifications of how the software in the tar ball was to be installed. • Working with tar balls was inconvenient for several reasons. 1. There was no standardization. 2. When using tar balls, there was no way to track what was installed. 3. Updating and de-installing tar balls was difficult to do.
  • 4. • In some cases, the tar ball contained source files that still needed to be compiled. In other cases, the tar ball had a nice installation script. In other situations still, the tar ball would just include a bunch of files including a README file explaining what to do with the software. • The ability to trace software was needed to overcome the disadvantages of tar balls. The Red Hat Package Manager (RPM) is one of the standards designed to fulfill this need. • An RPM is basically an archive file. It is created with the cpio command. With RPM, there is also metadata describing what is in the package and where those different files should be installed. • Because RPM is so well organized, it is easy for an administrator to query exactly what is happening in it.
  • 5. • Another benefit of using RPM is that its database is created in the /var/lib/rpm directory. • This database keeps track of the exact version of files that are installed on the computer. • Thus, for an administrator, it is possible to query individual RPM files to see their contents. You can also query the database to see where a specific file comes from or what exactly is in the RPM.
  • 6. Understanding Meta Package Handlers • Even though RPM is a great step forward in managing software, there is still one inconvenience that must be dealt with—software dependency. • To standardize software, many programs used on Linux use libraries and other common components provided by other software packages. • That means to install package A, package B is required to be present. This way of dealing with software is known as a software dependency.
  • 7. • Imagine an administrator who wants to install a given package downloaded from the Internet. It’s possible that in order to install this package, the administrator would first have to install several other packages. This would be indicated by the infamous “Failed dependencies” message. • Sometimes the situation become worse that a real dependency hell can occur where, after downloading all of the missing dependencies, each of the downloaded packages would have its own set of dependencies. • The solution for dependency hell is the Meta Package Handler, which in Red Hat is known as yum (Yellowdog Update Manager), works with repositories, which are the installation sources that are consulted whenever a user wants to install a software package. • In the repositories, all software packages of your distribution are typically available.
  • 8. • While installing a software package using yum install somepackage, yum first checks to see whether there are any dependencies. • If there are, yum checks the repositories to see whether the required software is available in the repositories, and if it is, the administrator will see a list of software that yum wants to install as the required dependencies. • If you installed Red Hat Enterprise Linux with a valid registration key, the installation process sets up repositories at the Red Hat Network (RHN) server automatically for you. • With these repositories, you’ll always be sure that you’re using the latest version of the RPM available. If you installed a test system that cannot connect to RHN, you need to create your own repositories
  • 9. Creating Your Own Repositories If you have a Red Hat server installed that doesn’t have access to the official RHN repositories, you’ll need to set up your own repositories. This procedure is also useful if you want to copy all of your RPMs to a directory and use that directory as a repository.
  • 10. Setting Up Your Own Repository • First copy all of the RPM files from the Red Hat installation DVD to a directory that you’ll create on disk. • Next install and run the createrepo package and its dependencies. This package is used to create the metadata that yum uses while installing the • software packages. • While installing the createrepo package, you’ll see that some dependency problems have to be handled as well. 1. Use mkdir /repo to create a directory that you can use as a repository in the root of your server’s fi le system. 2. Insert the Red Hat installation DVD in the optical drive of your server. Assuming that you run the server in graphical mode, the DVD will be mounted automatically.
  • 11. 3. Use the cd /media/RHEL[Tab] command to go into the mounted DVD. Next use cd Packages, which brings you to the directory where all RPMs are by default. Now use cp * /repo to copy all of them to the /repo directory you just created. Once this is finished, you don’t need the DVD anymore. 4. Now use cd /repo to go to the /repo directory. From this directory, type rpm -ivh createrepo[Tab]. This doesn’t work, and it gives you a “ Failed dependencies” error. To install createrepo, you first need to install the deltarpm and python-deltarpm packages. Use rpm -ivh deltarpm[Tab] python-deltarpm[Tab] to install both of them. Next, use rpm -ivh createrepo[Tab] again to install the createrepo package. 5. Once the createrepo package has been installed, use createrepo /repo, which creates the metadata that allows you to use the /repo directory as a repository. This will take a few minutes. When this procedure is finished, your repository is ready for use.
  • 12. Managing Repositories • In the preceding section, we learned how to turn a directory that contains RPMs into a repository. However, just marking a directory as a repository isn’t enough. • To use your newly created repository, you’ll have to tell your server where it can find it. To do this, you need to create a repository file in the directory /etc/yum.repos.d. • You’ll probably already have some repository files in this directory.
  • 13.
  • 14. • In the sample file in Listing 4.3, you will find all elements that a repository file should contain. • First, between square brackets there is an identifier for the repository. It allows you to recognize the repository easily later, and it’s used on your computer only and name parameter gives a name to the repository. • The important parameter is baseurl which tells where the repository can be found in URL format. As you can see in this example, an FTP server at Red Hat is specified. • Alternatively, you can also use URLs that refer to a website or to a directory that is local on your server’s hard drive. • The file:// part is the URI, which tells yum that it has to look at a file, and after that, you need a complete path to the file or directory, which in this case is /yourrepository
  • 15. • Next the parameter enabled specifies whether this repository is enabled. A 0 indicates that it is not, and if you really want to use this repository, this parameter should have 1 as its value. • The last part of the repository specifies if a GPG file is available. Because RPM packages are installed as root and can contain scripts that will be executed as root without any warning. GPG helps in guaranteeing the integrity of software packages you are installing. • To check whether packages have been tampered with, a GPG check is done on each package that you’ll install. To do this check, you need the GPG files installed locally on your computer. As you can see, some GPG files that are used by Red Hat are installed on your computer by default. Their location is specified using the gpgkey option. • Next the option gpgcheck=1 tells yum that it has to perform the GPG integrity check. If you’re having a hard time configuring the GPG check, you can change this parameter to gpgcheck=0, which completely disables the GPG check for RPMs that are found in this repository.
  • 16. Installing Software with Yum After configuring the repositories, you can install, query, update, and remove software with the meta package handler yum. This tool is easy to understand and intuitive. Searching Packages with Yum • To manage software with yum, the first step is often to search for the software you’re seeking. • The command yum search will do this for you. If you’re looking for a package with the name nmap, for example, use yum search nmap. Yum will come back with a list of all packages that match the search string, but it looks for it only in the package name and summary. Otherwise you can try yum search all, which will also look in the package description.
  • 17. • If you are looking for the name of a specific file, use yum provides or its equivalent, yum whatprovides command also checks the repository metadata for files that are in a package, and it tells you exactly which package you need to find a specific file. • You have to specify it as */nameofthefile. For example, the following command searches in yum for the package that contains the file zcat: yum provides */zcat. • Sometimes it takes a while to search for packages with yum because it works with indexes that it has to download and update periodically from the repositories. • Once these indexes are downloaded, yum will work a bit faster. • You can force yum to clear everything it has cached and download new index files by using yum clean all.
  • 18. Installing and Updating Packages • Once you’ve found the package you were seeking, you can install it using yum install. • For instance, if you want to install the network analysis tool nmap, after verifying that the name of the package is indeed nmap, use yum install nmap to install the tool. • Yum will then check the repositories to find out where it can find the most recent version of the program you’re seeking, and after finding it, yum shows you what it wants to install. • If there are no dependencies, it will show just one package. However, if there are dependencies, it displays a list of all the packages it needs to install in order to give you what you want. • Next, type Y to confirm that you really want to install what yum has proposed, and the software will be installed
  • 19. • There are two useful options when working with yum install. The first option, -y, can be used to automate things a bit. If you don’t use it, yum will first display a summary of what it wants to install. Next it will prompt you to confirm, after which it will start the installation. Use yum install -y to proceed immediately, without any additional prompts for confirmation. • Another useful yum option is --nogpgcheck. If you don’t want to perform a GPG check to install a package, just add --nogpgcheck to your yum install command. For instance, use yum install -y --nogpgcheck xinetd if you want to install the xinetd package without performing a GPG check and without having to confirm the installation.
  • 20. • In some cases, you may need to install an individual software package that is not in a repository but that you’ve downloaded as an RPM package. • To install such packages, you could use the command rpm -ivh packagename.rpm. However, this command doesn’t update the yum database, and therefore it’s not a good idea to install packages using the rpm command. Use yum localinstall instead. This will update the yum database and also check the repositories to try to fix all potential dependency problems automatically, like you are used to when using yum install.
  • 21. • If a package has already been installed, you can use yum update to update it. Use this command with the name of the specific package you want to update, or just use yum update to check all repositories and find out whether more recent versions of the packages you’re updating are available. • Normally, updating a package will remove the older version of a package, replacing it completely with the latest version. An exception occurs when you want to update the kernel. • The command yum update kernel will install the newer version of the kernel, while keeping the older version on your server. • It is useful because it allows you to boot the old kernel in case the new kernel is giving you problems
  • 22. Removing Packages • As is the case for installing packages, removing is also easy to do with yum. Just use yum remove followed by the name of the package you want to uninstall. • For instance, to remove the package nmap, use yum remove nmap. The yum remove command will first provide an overview of what exactly it intends to do. • In this overview, it will display the name of the package it intends to remove and all packages that depend on this package. • It is very important that you read carefully what yum intends to do. If the package you want to remove has many dependencies, by default yum will remove these dependencies as well. In some cases, it is not a good idea to proceed with the default setting.
  • 23. Working with Package Groups • To simplify installing software, yum works with the concept of package groups. In a package group, you will find all software that relates to specific functionality, as in the package group Virtualization, which contains all packages that are used to implement a virtualization solution on your server. • To get more information about the packages in a yum group, use the yum groupinfo command. For instance, yum groupinfo Virtualization displays a list of all packages within this group. • Next use yum groupinstall Virtualization to install all packages in the group.
  • 24. Command and its Use: 1. yum search: Search for a package based on its name or a word in the package summary. 2. yum provides */filename: Search in yum packages to find the package that contains a filename. 3. yum install: Install packages from the repositories. 4. yum update [packagename]: Update all packages on your server or a specific one, if you include a package name. 5. yum localinstall: Install a package that is not in the repositories but available as an RPM file. 6. yum remove: Remove a package. 7. yum list installed: Provide a list of all packages that are installed. This is useful in combination with grep or to check whether a specific package has been installed. 8. yum grouplist: Provide a list of all yum package groups. 9. yum groupinstall: Install all packages in a package group.
  • 25. Querying Software • Querying software helps you in a generic way to get more information about software installed on your computer. Querying RPM packages also helps you fix specific problems with packages. • There are many ways to query software packages. There are two ways to perform a query. You can query packages that are currently installed on your system, and it’s also possible to install package files that haven’t yet been installed. • To query an installed package, you can use one of the rpm -q options. To get information about a package that hasn’t yet been installed, you need to add the -p option.
  • 26. • A very common way to query RPM packages is by using rpm -qa. This command generates a list of all RPM packages that are installed on your server and thus provides a useful means for finding out whether some software has been installed. • A useful modification to rpm -qa is the -V option, which shows you if a package has been modified from its original version. • Using rpm -qVa thus allows you to perform a basic integrity check on the software you have on your server. Every file that is shown in the output of this command has been modified since it was originally installed. • The different query options that allow you to obtain information about installed packages, or about packages you are about to install, is also very useful.
  • 27. •Query options for installed packages Query command and Result: 1. rpm -ql packagename- Lists all files in package name 2. rpm -qc packagename- Lists all configuration files in package name 3. rpm -qd packagename -Lists all documentation files in package name. • A particularly useful query option is the --scripts option. • Use rpm -q --scripts packagename to apply this option. This option is useful because it shows the scripts that are executed when a package is installed. • There is one more useful query option: rpm -qf. You can use this option to find out from which file a package originated.
  • 28. Extracting Files from RPM Packages • Software installed on your computer may become damaged. If this happens, then you can extract files from the packages and copy them to the original location of the file. • Every RPM package consists of two parts: the metadata part that describes what is in the package and a cpio archive that contains the actual files in the package. • If a file has been damaged, you can start with the rpm -qf query option to find out from what package the file originated. • Next use rpm2cpio | cpio -idmv to extract the files from the package to a temporary location
  • 29. UNIVERSITY QUESTIONS 1. How to set up your own repository? 2. Explain installing and updating packages with yum. 3. Write a note on RPM and YUM in Linux. 4. Write steps to create and manage repositories.

Editor's Notes

  1. GPG file : GnuPrivacy Guard (GPG) allows you to securely encrypt files so that only the intended recipient can decrypt them