RPM Redhat Package Manager T Shrinivasan [email_address]
Install Packages <ul><li>Source Compilation
Installpkg
Rpm
dpkg </li></ul>
What RPM can do? <ul><li>Install
Remove
Query
Verify
Upgrade </li></ul>
Who use it? <ul><ul><li>Redhat
Fedora
CentOS
Mandriva
SuSE
... </li></ul></ul>
RPM Terminology kernel-smp-2.4.18-3.athlon.rpm kernel-smp-2.4.18-3.i586.rpm kernel-smp-2.4.18-3.i686.rpm kernel-source-2.4...
RPM Database Dir : /var/lib/rpm  # cd /var/lib/rpm # ls total 3534 -rw-r--r--  1 root  root  1351680 Oct 17 10:35 fileinde...
Operations
Some Commands <ul><li>rpm -U filename.rpm </li></ul><ul><li>rpm -i xcopilot-0.6.6-3.i386.rpm </li></ul><ul><li>rpm -U xcop...
rpm -Uhv xcopilot-0.6.6-3.i386.rpm
rpm –e package_name
rpm –qa | more  </li></ul>
Install <ul><li>Performing dependency checks.
Checking for conflicts.
Performing any tasks required before the install.
Deciding what to do with config files.
Unpacking files from the package and putting them in the proper place.
Performing any tasks required after the install.
Keeping track of what it did.  </li></ul>
Install Options
Examples # rpm -ivv eject-1.2-2.i386.rpm D: installing eject-1.2-2.i386.rpm Installing eject-1.2-2.i386.rpm D: package: ej...
Examples # rpm -i --test rpm-2.0.11-1.i386.rpm /bin/rpm conflicts with file from rpm-2.3-1 /usr/bin/gendiff conflicts with...
Upcoming SlideShare
Loading in...5
×

Rpm Introduction

1,654

Published on

A slide to introduce RPM

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

  • Be the first to like this

No Downloads
Views
Total Views
1,654
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
71
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Rpm Introduction

  1. 1. RPM Redhat Package Manager T Shrinivasan [email_address]
  2. 2. Install Packages <ul><li>Source Compilation
  3. 3. Installpkg
  4. 4. Rpm
  5. 5. dpkg </li></ul>
  6. 6. What RPM can do? <ul><li>Install
  7. 7. Remove
  8. 8. Query
  9. 9. Verify
  10. 10. Upgrade </li></ul>
  11. 11. Who use it? <ul><ul><li>Redhat
  12. 12. Fedora
  13. 13. CentOS
  14. 14. Mandriva
  15. 15. SuSE
  16. 16. ... </li></ul></ul>
  17. 17. RPM Terminology kernel-smp-2.4.18-3.athlon.rpm kernel-smp-2.4.18-3.i586.rpm kernel-smp-2.4.18-3.i686.rpm kernel-source-2.4.18-3.i386.rpm rootfiles-7.2-1.noarch.rpm name-version-release.architecture.rpm
  18. 18. RPM Database Dir : /var/lib/rpm # cd /var/lib/rpm # ls total 3534 -rw-r--r-- 1 root root 1351680 Oct 17 10:35 fileindex.rpm -rw-r--r-- 1 root root 16384 Oct 17 10:35 groupindex.rpm -rw-r--r-- 1 root root 16384 Oct 17 10:35 nameindex.rpm -rw-r--r-- 1 root root 2342536 Oct 17 10:35 packages.rpm -rw-r--r-- 1 root root 16384 Oct 17 10:35 providesindex.rpm -rw-r--r-- 1 root root 16384 Oct 17 10:35 requiredby.rpm #
  19. 19. Operations
  20. 20. Some Commands <ul><li>rpm -U filename.rpm </li></ul><ul><li>rpm -i xcopilot-0.6.6-3.i386.rpm </li></ul><ul><li>rpm -U xcopilot-0.6.6-3.i386.rpm
  21. 21. rpm -Uhv xcopilot-0.6.6-3.i386.rpm
  22. 22. rpm –e package_name
  23. 23. rpm –qa | more </li></ul>
  24. 24. Install <ul><li>Performing dependency checks.
  25. 25. Checking for conflicts.
  26. 26. Performing any tasks required before the install.
  27. 27. Deciding what to do with config files.
  28. 28. Unpacking files from the package and putting them in the proper place.
  29. 29. Performing any tasks required after the install.
  30. 30. Keeping track of what it did. </li></ul>
  31. 31. Install Options
  32. 32. Examples # rpm -ivv eject-1.2-2.i386.rpm D: installing eject-1.2-2.i386.rpm Installing eject-1.2-2.i386.rpm D: package: eject-1.2-2 files test = 0 D: running preinstall script (if any) D: setting file owners and groups by name (not id) D: ///usr/bin/eject owned by root (0), group root (0) mode 755 D: ///usr/man/man1/eject.1 owned by root (0), group root (0) mode 644 D: running postinstall script (if any) #
  33. 33. Examples # rpm -i --test rpm-2.0.11-1.i386.rpm /bin/rpm conflicts with file from rpm-2.3-1 /usr/bin/gendiff conflicts with file from rpm-2.3-1 /usr/bin/rpm2cpio conflicts with file from rpm-2.3-1 /usr/bin/rpmconvert conflicts with file from rpm-2.3-1 /usr/man/man8/rpm.8 conflicts with file from rpm-2.3-1 error: rpm-2.0.11-1.i386.rpm cannot be installed #
  34. 34. UnInstall rpm -e <ul><ul><ul><li>It checks the RPM database to make sure that no other packages depend on the package being erased.
  35. 35. It executes a pre-uninstall script (if one exists).
  36. 36. It checks to see if any of the package's config files have been modified. If so, it saves copies of them.
  37. 37. It reviews the RPM database to find every file listed as being part of the package, and if they do not belong to another package, deletes them.
  38. 38. It executes a post-uninstall script (if one exists).
  39. 39. It removes all traces of the package (and the files belonging to it) from the RPM database. </li></ul></ul></ul>
  40. 40. Erase Example # rpm -evv eject D: uninstalling record number 286040 D: running preuninstall script (if any) D: removing files test = 0 D: /usr/man/man1/eject.1 - removing D: /usr/bin/eject - removing D: running postuninstall script (if any) D: removing database entry D: removing name index D: removing group index D: removing file index for /usr/bin/eject D: removing file index for /usr/man/man1/eject.1 #
  41. 41. Upgrade
  42. 42. rpm -U <ul>Installs the desired package. Erases all older versions of the package, if any exist. </ul># rpm -U eject-1.2-2.i386.rpm
  43. 43. Query
  44. 44. Query Examples # rpm -q libc libc-5.2.18-1 # rpm -qa | grep -i sysv SysVinit-2.64-2 # rpm -qf /bin/ls Fileutils-3.12-3 # rpm -qp foo.bar rpm-2.3-1
  45. 45. Query Examples # rpm -qi rpm Name : rpm Distribution: Red Hat Linux Vanderbilt Version : 2.3 Vendor: Red Hat Software Release : 1 Build Date: Tue Dec 24 09:07:59 1996 Install date: Thu Dec 26 23:01:51 1996 Build Host: porky.redhat.com Group : Utilities/System Source RPM: rpm-2.3-1.src.rpm Size : 631157 Summary : Red Hat Package Manager Description : RPM is a powerful package manager, which can be used to build, install, query, verify, update, and uninstall individual software packages. A package consists of an archive of files, and package information, including name, version, and description.
  46. 46. -c — Display the Package's List of Configuration Files # rpm -qc XFree86 /etc/X11/fs/config /etc/X11/twm/system.twmrc /etc/X11/xdm/GiveConsole /etc/X11/xdm/TakeConsole /etc/X11/xdm/Xaccess /etc/X11/xdm/Xresources /etc/X11/xdm/Xservers /etc/X11/xdm/Xsession /etc/X11/xdm/Xsetup_0 /etc/X11/xdm/chooser Query
  47. 47. -d — Display a List of the Package's Documentation # rpm -qdcf /sbin/dump /etc/dumpdates /usr/doc/dump-0.3-5 /usr/doc/dump-0.3-5/CHANGES /usr/doc/dump-0.3-5/COPYRIGHT /usr/doc/dump-0.3-5/INSTALL /usr/doc/dump-0.3-5/KNOWNBUGS /usr/doc/dump-0.3-5/THANKS /usr/doc/dump-0.3-5/dump-0.3.announce /usr/doc/dump-0.3-5/dump.lsm /usr/doc/dump-0.3-5/linux-1.2.x.patch Query
  48. 48. --scripts — Show Scripts Associated With a Package # rpm -q --scripts XFree86 preinstall script:(none) postinstall script: /sbin/ldconfig /sbin/pamconfig --add --service=xdm --password=none --sesslist=none preuninstall script: (none) postuninstall script: /sbin/ldconfig if [ &quot;$1&quot; = 0 ] ; then /sbin/pamconfig --remove --service=xdm --password=none --sesslist=none fi verify script: (none) Query
  49. 49. # rpm -qid bash Name :bash Distribution: Red Hat Linux (Picasso) Version :1.14.6 Vendor: Red Hat Software Release :2 Build Date: Sun Feb 25 13:59:26 1996 Install date:Mon May 13 12:47:22 1996 Build Host: porky.redhat.com Group :Shells Source RPM: bash-1.14.6-2.src.rpm Size :486557 Description :GNU Bourne Again Shell (bash) /usr/doc/bash-1.14.6-2 /usr/doc/bash-1.14.6-2/NEWS /usr/doc/bash-1.14.6-2/README /usr/doc/bash-1.14.6-2/RELEASE /usr/info/bash.info.gz /usr/man/man1/bash.1 # Finding Documentation for a Specific Package
  50. 50. # rpm -qa --queryformat '%10{NAME} %20{GROUP} ' | grep -i shells ash Shells bash Shells csh Shells mc Shells tcsh Shells # Finding Similar Packages
  51. 51. # rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date} ' | sort -nr | sed -e 's/^[^ ]* //' rpm-devel-2.3-1 Thu Dec 26 23:02:05 1996 rpm-2.3-1 Thu Dec 26 23:01:51 1996 pgp-2.6.3usa-2 Tue Oct 22 19:39:09 1996 … pamconfig-0.50-5 Tue Oct 15 17:23:22 1996 setup-1.5-1 Tue Oct 15 17:23:21 1996 # Finding Recently Installed Packages
  52. 52. # rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date} ' | sort -nr| less kernel-source-2.0.18-5 20608472 tetex-0.3.4-3 19757371 emacs-el-19.34-1 12259914 … rootfiles-1.3-1 3494 mkinitrd-1.0-1 1898 redhat-release-4.0-1 22 # Finding the Largest Installed Packages
  53. 53. Making Free space Find the documentation files rpm -qda|wc -l for i in `rpm -qda`; do if [ -f $i ]; then echo `ls -l $i|awk -F ' ' '{print $5}'`; fi; done >size
  54. 54. Verify <ul><li>Owner
  55. 55. Group
  56. 56. Mode
  57. 57. MD5 Checksum
  58. 58. Size
  59. 59. Major Number
  60. 60. Minor Number
  61. 61. Symbolic Link String
  62. 62. Modification Time </li></ul>
  63. 63. Misc Options <ul><li># rpm –rebuilddb
  64. 64. # rpm –initdb
  65. 65. # rpm –help|less
  66. 66. # rpm --version </li></ul>
  67. 67. SRPM – RPM with Source <ul><li>For automatic compilation and Installation
  68. 68. spec file </li></ul>
  69. 69. Where to get? <ul><li>rpm.pbone.net
  70. 70. rpmfind.net
  71. 71. dag.wieers.com/rpm/packages
  72. 72. freshrpms.net </li></ul>
  73. 73. Thanks <ul><li>http://www.rpm.org/max-rpm/
  74. 74. http://docs.fedoraproject.org/drafts/rpm-guide-en/index.html </li></ul>
  75. 75. Questions ?
  1. A particular slide catching your eye?

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

×