0
Red Hat
Package
Manager
RPM
1
What is RPM?
• RPM stands for
Red Hat Package Manager.
• RPM command is used for installing,
uninstalling, upgrading, quer...
What is RPM?
• With root privilege, you can use the
rpm command with appropriate
options to manage the RPM
software packag...
What is RPM?
• The Red Hat Package Manager (RPM)
is a toolset used to build and
manage software packages on UNIX
systems.
...
What is RPM?
• Package management is rather
simple in its principles, though it can
be tricky in its implementations.
• Br...
What is RPM?
• RPM arose out of the needs to do this
effectively, and no other meaningful
solution was available.
• RPM us...
What is RPM?
• The naming scheme of RPM files is
itself a standardized convention.
• RPMs have the format (name)-
(version...
Why Package
Management...?
• At first glance you may say to
yourself, "I can manage this myself.
It's not that many compon...
Why Package
Management...?
• But consider, say, KDE, which has a
mountain of components,
dependencies, and likes to stick
...
Why Package
Management...?
• Package management makes it all
easier. By letting a program maintain
the information about t...
Why Package
Management...?
• Installation becomes a snap.
• You select what you want, and ask the
system to take care of t...
Why Package
Management...?
• Dependencies, or additional
requirements for a software package,
are also managed seamlessly ...
Why Package
Management...?
• Management of installed packages is
also greatly facilitated by a good
package management sys...
Why Package
Management...?
• Lastly, this makes verification of a
software package quite easy to do.
• By knowing what pac...
Installation Using RPM
• This is the most basic RPM function,
and one of the most popular: the
installation of new softwar...
• If all goes well and send you back to
a command prompt without any
messages.
• Use the -v flag to turn on some
verbosity...
• All that gets printed out is the package
name, but no statistics on the
progress or what it did. You can get a
hash mark...
• For example, In the MySQL-client-
3.23.57-1.i386.rpm file:
MySQL-client – Package Name
3.23.57 – Version
1 – Release
...
1) The following rpm command installs
Mysql client package.
# rpm -ivh MySQL-client-3.23.57-
1.i386.rpm
Preparing...######...
rpm command and options
• -i : install a package
• -v : verbose
• -h : print hash marks as the
package archive is unpacked...
• Sometimes RPM will whine (complain)
about a dependency which is installed
but isn't registered. Perhaps you
installed it...
• On rare occassion RPM will mess up
and insist that you have a package
installed when you don't. While this is
usually a ...
2) Query all the RPM Packages using
rpm –qa
• -q query operation
• -a queries all installed packages
23
Installation Using...
• To identify whether a particular rpm
package is installed on your system,
combine rpm and grep command as
shown below. F...
3) Query a Particular RPM Package
using rpm -q
• The above example lists all
currently installed package. After
installati...
26
Installation Using RPM
Installation Using RPM
4) Query RPM Packages in a various
format using rpm –queryformat
• Rpm command provides an option –...
28
Installation Using RPM
5) Which RPM package does a file belong
to? – Use rpm –qf
• Let us say, you have list of files and you
would want to know ...
30
Installation Using RPM
6) Locate documentation of a package
that owns file using rpm –qdf
• Use the following to know the list of
documentations,...
Installation Using RPM
32
7) Information about Installed RPM
Package using rpm -qi
• rpm command provides a lot of
information about an installed
pa...
Installation Using RPM
34
• If you have an RPM file that you
would like to install, but want to
know more information about it
before installing, yo...
Installation Using RPM
36
-i : view information about an rpm
-p : specify a package name
37
Installation Using RPM
8) List all the Files in a Package using
rpm –qlp
• To list the content of a RPM
package, use the following
command, which...
Installation Using RPM
39
9) List the Dependency Packages
using rpm –qRP
40
Installation Using RPM
10) Find out the state of files in a
package using rpm –qsp
The following command is to find
state (installed, replaced or...
Installation Using RPM
42
11)Verify a Particular RPM Package
using rpm –Vp
Verifying a package compares
information about the installed files
in the...
44
Installation Using RPM
45
• 12. Verify a Package Owning file
using rpm -Vf
• The following command verify the
package which owns the given
filename....
• 13. Upgrading a RPM Package
using rpm –Uvh
• RPM automatically un-installs
existing versions of the package
before insta...
Installation Using RPM
48
14. Uninstalling a RPM Package
using rpm -e
• To remove an installed rpm package
using -e as shown below. After
uninstalla...
15. Verifying all the RPM Packages
using rpm -Va
• The following command verifies all
the installed packages.
50
Installat...
Installation Using RPM
51
Bibliography
1) http://linuxgazette.net/68/nazario.html
2) http://www.thegeekstuff.com/2010/07/r
pm-command-examples/
3) h...
Upcoming SlideShare
Loading in...5
×

Linux16 RPM

146

Published on

RedHat Package Manager

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
146
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Linux16 RPM"

  1. 1. Red Hat Package Manager RPM 1
  2. 2. What is RPM? • RPM stands for Red Hat Package Manager. • RPM command is used for installing, uninstalling, upgrading, querying, listing, and checking RPM packages on your Linux system. 2
  3. 3. What is RPM? • With root privilege, you can use the rpm command with appropriate options to manage the RPM software packages. 3
  4. 4. What is RPM? • The Red Hat Package Manager (RPM) is a toolset used to build and manage software packages on UNIX systems. • Distributed with the Red Hat Linux distribution and its derivatives, RPM also works on any UNIX as it is open source. 4
  5. 5. What is RPM? • Package management is rather simple in its principles, though it can be tricky in its implementations. • Briefly, it means the managed installation of software, managing installed software, and the removal of software packages from a system in a simplified manner. 5
  6. 6. What is RPM? • RPM arose out of the needs to do this effectively, and no other meaningful solution was available. • RPM uses a proprietary file format, unlike some other UNIX software package managers. 6
  7. 7. What is RPM? • The naming scheme of RPM files is itself a standardized convention. • RPMs have the format (name)- (version)-(build).(platform).rpm. • For example, the name cat-2.4- 7.i386.rpm would mean an RPM for the utility "cat" version 2.4, build 7 for the x86. 7
  8. 8. Why Package Management...? • At first glance you may say to yourself, "I can manage this myself. It's not that many components ..." In fact, for something as small as, say, cat, which has one executable and one man page, this may be so. 8
  9. 9. Why Package Management...? • But consider, say, KDE, which has a mountain of components, dependencies, and likes to stick them everywhere. • Keeping track of it all would be tough, if not impossible. 9
  10. 10. Why Package Management...? • Package management makes it all easier. By letting a program maintain the information about the binaries, their configuration files, and everything else about them, you can identify which ones are installed, remove them easily or upgrade them readily, as well. 10
  11. 11. Why Package Management...? • Installation becomes a snap. • You select what you want, and ask the system to take care of the dirty work for you. • Unpack the program, ensure that there is space, place things in the right order, and set them up for you. It's great, it's like having a valet take care of your car when you go to a restaurant. 11
  12. 12. Why Package Management...? • Dependencies, or additional requirements for a software package, are also managed seamlessly by a good package manager. 12
  13. 13. Why Package Management...? • Management of installed packages is also greatly facilitated by a good package management system. • It keeps a full list of software installed, which is useful to see if you have something installed. More importantly, it makes upgrading a breeze. 13
  14. 14. Why Package Management...? • Lastly, this makes verification of a software package quite easy to do. • By knowing what packages are installed, and what the properties of the components are, you can quickly diagnose a problem and hopefully fix it quickly. 14
  15. 15. Installation Using RPM • This is the most basic RPM function, and one of the most popular: the installation of new software packages using RPM. To do this, give rpm the -i flag and point it to an RPM: # rpm -i (package) 15
  16. 16. • If all goes well and send you back to a command prompt without any messages. • Use the -v flag to turn on some verbosity: # rpm -iv (package) 16 Installation Using RPM
  17. 17. • All that gets printed out is the package name, but no statistics on the progress or what it did. You can get a hash marked output of the progress is you use the -h flag. People seem to like using -ivh together to get a "pretty" output: # rpm -ivh (package) 17 Installation Using RPM
  18. 18. • For example, In the MySQL-client- 3.23.57-1.i386.rpm file: MySQL-client – Package Name 3.23.57 – Version 1 – Release i386 – Architecture 18 Installation Using RPM
  19. 19. 1) The following rpm command installs Mysql client package. # rpm -ivh MySQL-client-3.23.57- 1.i386.rpm Preparing...#################################### [100%] 1:MySQL-client ############################## [100%] 19 Installation Using RPM
  20. 20. rpm command and options • -i : install a package • -v : verbose • -h : print hash marks as the package archive is unpacked. 20 Installation Using RPM
  21. 21. • Sometimes RPM will whine (complain) about a dependency which is installed but isn't registered. Perhaps you installed it not using an RPM for the package (ie OpenSSL). To get around this, you can force it to ignore dependencies: # rpm -ivv --nodeps (package) 21 Installation Using RPM
  22. 22. • On rare occassion RPM will mess up and insist that you have a package installed when you don't. While this is usually a sign that something is amiss, it can be worked around. Just force the installation: • # rpm -ivv --force (package) 22 Installation Using RPM
  23. 23. 2) Query all the RPM Packages using rpm –qa • -q query operation • -a queries all installed packages 23 Installation Using RPM
  24. 24. • To identify whether a particular rpm package is installed on your system, combine rpm and grep command as shown below. Following command checks whether cdrecord package is installed on your system. # rpm -qa | grep 'cdrecord' 24 Installation Using RPM
  25. 25. 3) Query a Particular RPM Package using rpm -q • The above example lists all currently installed package. After installation of a package to check the installation, you can query a particular package and verify as shown below: 25 Installation Using RPM
  26. 26. 26 Installation Using RPM
  27. 27. Installation Using RPM 4) Query RPM Packages in a various format using rpm –queryformat • Rpm command provides an option – queryformat, which allows you to give the header tag names, to list the packages. Enclose the header tag with in {}. 27
  28. 28. 28 Installation Using RPM
  29. 29. 5) Which RPM package does a file belong to? – Use rpm –qf • Let us say, you have list of files and you would want to know which package owns all these files. rpm command has options to achieve this. • The following example shows that /usr/bin/mysqlaccess file is part of the MySQL-client-3.23.57-1 rpm. 29 Installation Using RPM
  30. 30. 30 Installation Using RPM
  31. 31. 6) Locate documentation of a package that owns file using rpm –qdf • Use the following to know the list of documentations, for a package that owns a file. The following command, gives the location of all the manual pages related to mysql package. 31 Installation Using RPM
  32. 32. Installation Using RPM 32
  33. 33. 7) Information about Installed RPM Package using rpm -qi • rpm command provides a lot of information about an installed pacakge using rpm -qi as shown below: 33 Installation Using RPM
  34. 34. Installation Using RPM 34
  35. 35. • If you have an RPM file that you would like to install, but want to know more information about it before installing, you can do the following: 35 Installation Using RPM
  36. 36. Installation Using RPM 36
  37. 37. -i : view information about an rpm -p : specify a package name 37 Installation Using RPM
  38. 38. 8) List all the Files in a Package using rpm –qlp • To list the content of a RPM package, use the following command, which will list out the files without extracting into the local directory folder. 38 Installation Using RPM
  39. 39. Installation Using RPM 39
  40. 40. 9) List the Dependency Packages using rpm –qRP 40 Installation Using RPM
  41. 41. 10) Find out the state of files in a package using rpm –qsp The following command is to find state (installed, replaced or normal) for all the files in a RPM package. 41 Installation Using RPM
  42. 42. Installation Using RPM 42
  43. 43. 11)Verify a Particular RPM Package using rpm –Vp Verifying a package compares information about the installed files in the package with information about the files taken from the package metadata stored in the rpm database. 43 Installation Using RPM
  44. 44. 44 Installation Using RPM
  45. 45. 45
  46. 46. • 12. Verify a Package Owning file using rpm -Vf • The following command verify the package which owns the given filename. 46 Installation Using RPM
  47. 47. • 13. Upgrading a RPM Package using rpm –Uvh • RPM automatically un-installs existing versions of the package before installing the new one. If an old version of the package is not found, the upgrade option will still install it. 47 Installation Using RPM
  48. 48. Installation Using RPM 48
  49. 49. 14. Uninstalling a RPM Package using rpm -e • To remove an installed rpm package using -e as shown below. After uninstallation, you can query using rpm -qa and verify the uninstallation. 49 Installation Using RPM
  50. 50. 15. Verifying all the RPM Packages using rpm -Va • The following command verifies all the installed packages. 50 Installation Using RPM
  51. 51. Installation Using RPM 51
  52. 52. Bibliography 1) http://linuxgazette.net/68/nazario.html 2) http://www.thegeekstuff.com/2010/07/r pm-command-examples/ 3) http://linuxtutorial.info/modules.php? name=Howto&pagename=RPM- HOWTO/intro.html
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×