SlideShare a Scribd company logo
1 of 22
Package Management in
Red Hat
Package Management
• Software is the basis of any operating system, allowing you to install and
use different utilities.
• In Linux, software is distributed through the use of packages, which
contain the actual software files.
• Each distribution of Linux has its own package management system.
• For Red Hat, there are two package management systems: RPM and Yum
2
Working with RPM
• A package contains a directory structure that is composed of files to make up
the software application.
• In Red Hat, packages have the .rpm extension and can be installed through
different means.
3
Naming Convention RPM
• Package Syntax: package_name-version-release.arch.rpm
• As an example, let’s look at the postfix package, which is used to install an SMTP
mail server:
• postfix-2.6.6-2.el6.x86_64.rpm
• Name of this package is postfix, the version number is 2.6.6, and it is meant for a
64-bit operating system.
• The -2 is the release, and the el6 is something you find only in Red Hat packages
because it specifies an internal version number for the Red Hat release.
4
Package Dependency
• Sometimes for an installation it requires to install another as well; this is known
as a dependency.
• Certain packages require certain versions to make sure that their dependencies
don’t break when upgrading.
• You can see why being able to get version information from packages is a
necessary skill.
• All packages are held within a repository somewhere, depending on who
produces the package.
• Red Hat has its own software repositories, which hold the packages for the Red
Hat operating system.
5
Installing and Removing Packages
• RPM is the utility is used to manage individual packages outside the repositories.
• Used to install .rpm packages that are downloaded (either manually from the
repositories or the Web).
• Syntax: rpm [options]
6
RPM Options 7
The options for rpm are divided into three different sections
(modes): install/upgrade/erase, query, and verify.
RPM Options 8
Downloading an RPM 9
To download something from the command line, use the wget
command.
Step 1. Download the nano package from the Web:
# wget http://www.nano-editor.org/dist/v2.2/RPMS/nano-2.2.6-
1.x86_64.rpm
Step 2. When the download is finished, the package is in the present
working directory.
Install it with the rpm command:
# rpm -ivh nano-2.2.6-1.x86_64.rpm
Issue in RPM 10
Upgrade and Delete an RPM
• To upgrade the package, if the package isn’t already installed:
• # rpm -Uvh nano-2.2.6-1.x86_64.rpm
• To delete an installed package, use the -e option to remove it:
• # rpm -e nano
• You can always reinstall the package at a later date if you keep the .rpm
file on your system (or you can always download it again).
11
Querying and Verifying Packages
• Query the installed system packages
• # rpm -qa | grep [package name]
• Query the installed system packages for nano:
• # rpm -qa | grep nano
12
man pages
• There is usually a documentation for a given package. This documentation is
known as a package’s man pages, and most packages come with them.
• To access the man pages, use the man command:
• # man nano
• Scroll up and down to view the documentation and press q to quit.
• man pages provide in-depth details, usage, and examples for any given
package.
13
YUM (Yellow dog Update Modifier)
• The yum command has access to repositories where tons of
packages are kept and can install, upgrade, or remove them for you
automatically.
• Yum also takes care of resolving and installing any dependencies for
you, which the rpm command can’t do
14
Syntax: yum [options] command
•Options:
• -c Specifies the location of the config file
• -q Specifies quiet, no output
• -y Indicates to always answer yes to prompts
• -v Provides verbose output
15
Commands
• clean Removes cached data
• erase Removes a package from the system
• grouplist Displays available package groups
• groupinstall Installs the packages within a group
• Info Displays information about a package
• install Installs a package on the system
• search Enables you to search for a package
• update Updates a package
16
Installing and Removing Packages
• Directly from the Red Hat repositories:
• # yum install -y postfix
• You could also update the postfix package. Just change the
command from install to update:
• # yum update -y postfix
• Use remove here because you don’t want anything lingering
around at the moment:
• # yum remove -y postfix
• One great feature about yum is that instead of updating a single
package, you can list all updates that need to be installed for the
system:
• # yum list updates
17
YUM Commands
• From this list, you can choose to update packages individually or as
a whole. If you want to install all the updates, you can use the
following:
• # yum update
• Keeps a list of “groups” that contain a set of packages, making it
easier to install sets of packages together.
• The most common example would be if you wanted to install an X
server package so that your system has a GUI. You can use the
grouplist command to get a listing of all available “groups”:
• # yum grouplist
18
Searching for Packages
• Gives you access to the repositories from which you can install
software
• Use the search command to query software packages from the
repositories.
• Find the postfix package to install:
• # yum search postfix
• To find out more information about the postfix package, use the
following command:
• # yum info postfix
19
Clean Command
• One additional command that you can use with yum (rpm
doesn’t have an equivalent option) is the clean
command.
• It wipes the yum cache and forces it to sync with the Red
Hat repositories, giving you the most updated package
information.
• To flush the cache, do the following:
• # yum clean all
20
Configuring Additional Repositories
• Sometimes you might want to install a package that isn’t in the
repositories that come preconfigured with Red Hat.
• If the package is available in someone else’s repository, you can
add that person’s repository to your yum config file.
• You can either add your own custom repositories to the main
config file /etc/yum.conf or create a .repo file in the
/etc/yum.repos.d directory, which will be added automatically.
21
Configuring Additional Repositories
• Here is what a sample entry for a custom repository looks like:
[unique title]
name=My Custom Yum Repository
baseurl=ftp://rhel01/opt/yum/myrepos
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-
redhat-release
• This entry defines a name, a location, and whether or not the repository is
enabled.
• You can save this entry as a test.repo file in /etc/yum.repos.d, and you will
have access to any of the packages in the /opt/yum/myrepos repository on the
RHEL01 system.
22

More Related Content

Similar to 6 - Package Management in Red Hat

Linux packege manager
Linux packege managerLinux packege manager
Linux packege managerInfoExcavator
 
Linux Package Management.pptx
Linux Package Management.pptxLinux Package Management.pptx
Linux Package Management.pptxHussienEndris1
 
Installing Software, Part 2: Package Managers
Installing Software, Part 2: Package ManagersInstalling Software, Part 2: Package Managers
Installing Software, Part 2: Package ManagersKevin OBrien
 
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
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.İbrahim UÇAR
 
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
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinuxtutorialsruby
 
Oracle11g On Fedora14
Oracle11g On Fedora14Oracle11g On Fedora14
Oracle11g On Fedora14kmsa
 
Building Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchBuilding Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchSherif Mousa
 
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
 

Similar to 6 - Package Management in Red Hat (20)

Linux packege manager
Linux packege managerLinux packege manager
Linux packege manager
 
Linux packege manager
Linux packege managerLinux packege manager
Linux packege manager
 
Linux Package Management.pptx
Linux Package Management.pptxLinux Package Management.pptx
Linux Package Management.pptx
 
Installing Software, Part 2: Package Managers
Installing Software, Part 2: Package ManagersInstalling Software, Part 2: Package Managers
Installing Software, Part 2: Package Managers
 
RHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & RecoveryRHEL Log-files, RPM, Backup & Recovery
RHEL Log-files, RPM, Backup & Recovery
 
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
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
$ make install
$ make install$ make install
$ make install
 
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
 
How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.How to Build Package in Linux Based Systems.
How to Build Package in Linux Based Systems.
 
Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management Course 102: Lecture 22: Package Management
Course 102: Lecture 22: Package Management
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
InstallingRoRinLinux
InstallingRoRinLinuxInstallingRoRinLinux
InstallingRoRinLinux
 
Oracle11g On Fedora14
Oracle11g On Fedora14Oracle11g On Fedora14
Oracle11g On Fedora14
 
Oracle11g on fedora14
Oracle11g on fedora14Oracle11g on fedora14
Oracle11g on fedora14
 
Building Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 ArchBuilding Mini Embedded Linux System for X86 Arch
Building Mini Embedded Linux System for X86 Arch
 
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
 

More from Shafaan Khaliq Bhatti

15 lecture - acl part1, introduction to access control list
15   lecture  - acl part1, introduction to access control list15   lecture  - acl part1, introduction to access control list
15 lecture - acl part1, introduction to access control listShafaan Khaliq Bhatti
 
13 lecture - introduction and configuration of eigrp
13   lecture  - introduction and configuration of eigrp13   lecture  - introduction and configuration of eigrp
13 lecture - introduction and configuration of eigrpShafaan Khaliq Bhatti
 
10 lecture - ospf part1 , introduction to ospf , areas and abr
10   lecture  - ospf part1 , introduction to ospf , areas and abr10   lecture  - ospf part1 , introduction to ospf , areas and abr
10 lecture - ospf part1 , introduction to ospf , areas and abrShafaan Khaliq Bhatti
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardShafaan Khaliq Bhatti
 
Chapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityChapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityShafaan Khaliq Bhatti
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System StructuresShafaan Khaliq Bhatti
 

More from Shafaan Khaliq Bhatti (20)

1- Introduction to Red Hat
1- Introduction to Red Hat1- Introduction to Red Hat
1- Introduction to Red Hat
 
Linux Servers
Linux ServersLinux Servers
Linux Servers
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
2- System Initialization in Red Hat
2- System Initialization in Red Hat2- System Initialization in Red Hat
2- System Initialization in Red Hat
 
3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red Hat3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red Hat
 
11 - SELinux in Red Hat
11 - SELinux in Red Hat11 - SELinux in Red Hat
11 - SELinux in Red Hat
 
7 - User Administration in Red Hat
7 - User Administration in Red Hat7 - User Administration in Red Hat
7 - User Administration in Red Hat
 
12 - System Security in Red Hat
12 - System Security in Red Hat12 - System Security in Red Hat
12 - System Security in Red Hat
 
15 lecture - acl part1, introduction to access control list
15   lecture  - acl part1, introduction to access control list15   lecture  - acl part1, introduction to access control list
15 lecture - acl part1, introduction to access control list
 
13 lecture - introduction and configuration of eigrp
13   lecture  - introduction and configuration of eigrp13   lecture  - introduction and configuration of eigrp
13 lecture - introduction and configuration of eigrp
 
10 lecture - ospf part1 , introduction to ospf , areas and abr
10   lecture  - ospf part1 , introduction to ospf , areas and abr10   lecture  - ospf part1 , introduction to ospf , areas and abr
10 lecture - ospf part1 , introduction to ospf , areas and abr
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, Hashes
 
Protocols for Public Key Management
Protocols for Public Key ManagementProtocols for Public Key Management
Protocols for Public Key Management
 
Authentication: keys, MAC
Authentication: keys, MACAuthentication: keys, MAC
Authentication: keys, MAC
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Block Ciphers Modes of Operation
Block Ciphers Modes of OperationBlock Ciphers Modes of Operation
Block Ciphers Modes of Operation
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption Standard
 
Chapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityChapter 1: Overview of Network Security
Chapter 1: Overview of Network Security
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 

6 - Package Management in Red Hat

  • 2. Package Management • Software is the basis of any operating system, allowing you to install and use different utilities. • In Linux, software is distributed through the use of packages, which contain the actual software files. • Each distribution of Linux has its own package management system. • For Red Hat, there are two package management systems: RPM and Yum 2
  • 3. Working with RPM • A package contains a directory structure that is composed of files to make up the software application. • In Red Hat, packages have the .rpm extension and can be installed through different means. 3
  • 4. Naming Convention RPM • Package Syntax: package_name-version-release.arch.rpm • As an example, let’s look at the postfix package, which is used to install an SMTP mail server: • postfix-2.6.6-2.el6.x86_64.rpm • Name of this package is postfix, the version number is 2.6.6, and it is meant for a 64-bit operating system. • The -2 is the release, and the el6 is something you find only in Red Hat packages because it specifies an internal version number for the Red Hat release. 4
  • 5. Package Dependency • Sometimes for an installation it requires to install another as well; this is known as a dependency. • Certain packages require certain versions to make sure that their dependencies don’t break when upgrading. • You can see why being able to get version information from packages is a necessary skill. • All packages are held within a repository somewhere, depending on who produces the package. • Red Hat has its own software repositories, which hold the packages for the Red Hat operating system. 5
  • 6. Installing and Removing Packages • RPM is the utility is used to manage individual packages outside the repositories. • Used to install .rpm packages that are downloaded (either manually from the repositories or the Web). • Syntax: rpm [options] 6
  • 7. RPM Options 7 The options for rpm are divided into three different sections (modes): install/upgrade/erase, query, and verify.
  • 9. Downloading an RPM 9 To download something from the command line, use the wget command. Step 1. Download the nano package from the Web: # wget http://www.nano-editor.org/dist/v2.2/RPMS/nano-2.2.6- 1.x86_64.rpm Step 2. When the download is finished, the package is in the present working directory. Install it with the rpm command: # rpm -ivh nano-2.2.6-1.x86_64.rpm
  • 11. Upgrade and Delete an RPM • To upgrade the package, if the package isn’t already installed: • # rpm -Uvh nano-2.2.6-1.x86_64.rpm • To delete an installed package, use the -e option to remove it: • # rpm -e nano • You can always reinstall the package at a later date if you keep the .rpm file on your system (or you can always download it again). 11
  • 12. Querying and Verifying Packages • Query the installed system packages • # rpm -qa | grep [package name] • Query the installed system packages for nano: • # rpm -qa | grep nano 12
  • 13. man pages • There is usually a documentation for a given package. This documentation is known as a package’s man pages, and most packages come with them. • To access the man pages, use the man command: • # man nano • Scroll up and down to view the documentation and press q to quit. • man pages provide in-depth details, usage, and examples for any given package. 13
  • 14. YUM (Yellow dog Update Modifier) • The yum command has access to repositories where tons of packages are kept and can install, upgrade, or remove them for you automatically. • Yum also takes care of resolving and installing any dependencies for you, which the rpm command can’t do 14
  • 15. Syntax: yum [options] command •Options: • -c Specifies the location of the config file • -q Specifies quiet, no output • -y Indicates to always answer yes to prompts • -v Provides verbose output 15
  • 16. Commands • clean Removes cached data • erase Removes a package from the system • grouplist Displays available package groups • groupinstall Installs the packages within a group • Info Displays information about a package • install Installs a package on the system • search Enables you to search for a package • update Updates a package 16
  • 17. Installing and Removing Packages • Directly from the Red Hat repositories: • # yum install -y postfix • You could also update the postfix package. Just change the command from install to update: • # yum update -y postfix • Use remove here because you don’t want anything lingering around at the moment: • # yum remove -y postfix • One great feature about yum is that instead of updating a single package, you can list all updates that need to be installed for the system: • # yum list updates 17
  • 18. YUM Commands • From this list, you can choose to update packages individually or as a whole. If you want to install all the updates, you can use the following: • # yum update • Keeps a list of “groups” that contain a set of packages, making it easier to install sets of packages together. • The most common example would be if you wanted to install an X server package so that your system has a GUI. You can use the grouplist command to get a listing of all available “groups”: • # yum grouplist 18
  • 19. Searching for Packages • Gives you access to the repositories from which you can install software • Use the search command to query software packages from the repositories. • Find the postfix package to install: • # yum search postfix • To find out more information about the postfix package, use the following command: • # yum info postfix 19
  • 20. Clean Command • One additional command that you can use with yum (rpm doesn’t have an equivalent option) is the clean command. • It wipes the yum cache and forces it to sync with the Red Hat repositories, giving you the most updated package information. • To flush the cache, do the following: • # yum clean all 20
  • 21. Configuring Additional Repositories • Sometimes you might want to install a package that isn’t in the repositories that come preconfigured with Red Hat. • If the package is available in someone else’s repository, you can add that person’s repository to your yum config file. • You can either add your own custom repositories to the main config file /etc/yum.conf or create a .repo file in the /etc/yum.repos.d directory, which will be added automatically. 21
  • 22. Configuring Additional Repositories • Here is what a sample entry for a custom repository looks like: [unique title] name=My Custom Yum Repository baseurl=ftp://rhel01/opt/yum/myrepos enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY- redhat-release • This entry defines a name, a location, and whether or not the repository is enabled. • You can save this entry as a test.repo file in /etc/yum.repos.d, and you will have access to any of the packages in the /opt/yum/myrepos repository on the RHEL01 system. 22