Discuss IT and Design a variety of tutorials and design it. let's read that are useful to you. thank you for visiting my humble blog

Managing Software with RPM on openSUSE

Installing a Package with rpm
The following example uses wget to download the rar package, a compression and packaging utility. The example then installs the rpm package located in the current directory. Options in the rpm command include -U for update or install, -v for verbose, and
-h to show progress hash marks.

NOTE    The -i option of rpm can also be used to install a package. However, most people use the -U option because it causes the package you are installing to replace an earlier, existing package of the same name if one exists. You can use the -i option, however, if you want multiple instances of the same package to exist on the system. Having multiple kernel packages is an example of this.

 wget   \
 rpm -Uvh  rar-3.7.1-0.pm.0.i586.rpm
Preparing...                                 #####################################  [100%]
1:rar               ##################################### [100%]

Using the rar package as an example, the following command installs the package directly from the Internet. This approach works with http and ftp protocols.


 rpm -Uvh  \
Retrieving  http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm warning: /var/tmp/rpm-xfer.9eOu3a:  Header V3 DSA  signature:  NOKEY,  key   ID
9a795806
Preparing...                                 ###########################################  [100%]
1:rar                                       ###########################################  [100%]


Upgrading a Package with rpm
If an older version of the package is already installed, an error will occur. Use rpm
-Uvh to upgrade an existing package to a newer version:

 rpm -Uvh  \
Retrieving  http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.0-0.pm.0.i586.rpm warning:  /var/tmp/rpm-xfer.HgM2qb:  Header V3 DSA  signature:  NOKEY,  key   ID
9a795806
Preparing...                          ###########################################  [100%]
1:rar                               ###########################################  [100%]

This example installed an older version of the command. To upgrade, use the same
rpm command line options, but with a newer package. For example:

 rpm -Uvh  \
Retrieving  http://packman.iu-bremen.de/suse/10.3/i586/rar-3.7.1-0.pm.0.i586.rpm warning:  /var/tmp/rpm-xfer.HgM2qb:  Header V3 DSA  signature:  NOKEY,  key   ID




9a795806
Preparing...                                  ###########################################  [100%]
1:rar                                       ###########################################  [100%]


Removing a Package with rpm
To remove an installed package, use the -e option as follows:

 rpm -e flash-player

Sometimes, you will find that rpm will not remove a package due to failed dependen- cies.  This is one of the downsides of rpm it does not resolve these dependencies.

 rpm -e gzip
error:  Failed dependencies:
gzip is needed by  (installed)  perl-5.8.8-75.i586 gzip is  needed  by  (installed)  mkinitrd-2.1-36.i586
...

The command failed because of dependency issues. The best way to resolve depend- ency issues is to use zypper or yast to work through the dependencies automatically. However, you may reach a point where you have to force the install or removal of a package.

WARNING!    Forcing the install or removal of a package is DANGEROUS and may result in an unstable system. Make sure you know precisely what you’re doing.

In this example, you specify that you want to remove the i586 version of the zoo package and ignore dependencies:

 rpm –e  --nodeps zoo-2.10-938.i586


Querying Information about RPM Packages
The following example shows how to query installed packages for the zoo package and display version information about that package:

 rpm -q   zoo
zoo-2.10-938

Use the -qp option to get information about an RPM file in the present directory:

 rpm -qp   zoo-2.10-938.i586.rpm
zoo-2.10-938

To see a list of all the packages installed on your system, type the following:

 rpm -qa   | less
OpenOffice_org-templates-labels-letter-1.0-2



kdegames4-carddecks-other-3.93.0-4 glibc-i18ndata-2.6.1-18
...

Check a file on your system to see what package the file belongs to, if any:

 rpm -qf /etc/sysctl.conf
procps-3.2.7-67

Now that you know how to select the package(s) you want to query, let’s get a little more information out of them. This example lists standard details about an installed package:

 rpm -qi  zoo
Name              : zoo      Relocations: (not relocatable)
Version            : 2.10   Vendor: SUSE LINUX Products GmbH, Nuernberg,  Germany
Release          : 938      Build Date: Fri  31  Aug 2007  09:23:01 PM  CDT Install  Date: Sat 08  Sep  2007  12:47:21 PM  CDT
Build  Host   : martinu.suse.de
Group              : Productivity/Archiving/Compression
Source  RPM     : zoo-2.10-938.src.rpm
Size               : 110796
License          : Public  Domain, Freeware
Signature       : DSA/SHA1, Fri 31  Aug 2007   09:24:02 PM  CDT,  Key  ID  a84edae89c800aca
Packager          : http://bugs.opensuse.org
Summary         : Pack   Program
Description  :
Zoo   is a  packer based on  the  Lempel-Ziv algorithm.  Lots of files  on DOS/AmigaDOS and   TOS systems used  this  packer for their  archives. The compression rate  of gzip is  not reached, and   thus zoo   should  only be used for  decompressing old archives.

Authors:
--------
Ian  Phillipps           <igp@camcon.co.uk>
J.  Brian Waters    <jbwaters@bsu-cs.bsu.edu> Paul  Homchick     <rutgers!cgh!paul>
Mark   Alexander        <amdahl!drivax!alexande>
Randal  L. Barnes  <rlb@skyler.mavd.honeywell.com> Distribution: openSUSE  10.3 (i586)

This lists the content of an RPM file that’s in the local directory:

 rpm -qlp zoo-2.10-938.i586.rpm
/usr/bin/fiz
/usr/bin/zoo
/usr/share/doc/packages/zoo
/usr/share/doc/packages/zoo/Copyright
/usr/share/man/man1/fiz.1.gz
/usr/share/man/man1/zoo.1.gz




Combine various query options to check an RPM file before it’s installed:

 rpm -qilp  zoo-2.10-938.i586.rpm
...

Authors:
--------
Ian  Phillipps           <igp@camcon.co.uk>
J.  Brian Waters    <jbwaters@bsu-cs.bsu.edu> Paul  Homchick    <rutgers!cgh!paul>
Mark   Alexander        <amdahl!drivax!alexande>
Randal  L. Barnes  <rlb@skyler.mavd.honeywell.com> Distribution: openSUSE  10.3 (i586)
/usr/bin/fiz
/usr/bin/zoo
/usr/share/doc/packages/zoo
/usr/share/doc/packages/zoo/Copyright
/usr/share/man/man1/fiz.1.gz
/usr/share/man/man1/zoo.1.gz

This example lists preinstall and postinstall scripts that come with an installed RPM package:

 rpm -q   --scripts  kernel-default | less

Several other query options are available. See the rpm man page for details. The most powerful rpm query option is --queryformat (or --qf). It lets you build from scratch the output string. This queries all installed packages to see what host they were built on:

 rpm -qa   --queryformat  ‘Package %{NAME}  was  built  on  %{BUILDHOST}\n’  | less
Package  cracklib-dict-full was  built on  yggdrasil.suse.de
Package  openSUSE-release  was  built on  lrupp1.suse.de
Package OpenOffice_org-icon-themes  was  built on  cara.suse.de
...

The following command makes a sorted list of all non-SUSE packages:

 rpm -qa   --queryformat ‘%{VENDOR} %{NAME}\n’   | grep   -v “SUSE”  | sort

Here are a few more examples:

 rpm -qa   --qf ‘%{NAME}  is  licenced under   %{LICENSE}\n’
 rpm -qa   --qf ‘The   size of %{NAME}  is %{SIZE} bytes\n’
 rpm -qa   --qf  ‘For %{NAME}  get more  info here: %{URL}\n’
 rpm -qa   --qf  ‘For %{NAME}  the architecture  is: %{ARCH}\n’
 rpm -qa   --qf ‘The   %{NAME}  package is: %{SUMMARY}\n’

As you can imagine, the combinations are endless. Here’s how to list all of the variables:


 rpm --querytags | less
Share:

No comments:

Post a Comment

Popular Posts

Ismail Maha Putra. Powered by Blogger.
twitterfacebookgoogle pluslinkedinrss feedemail
SEO Reports for kendariit.blogspot.com

Followers

Blog Archive

Poll

Facebook Page Like

Translate

Get ThisWidget
Blogger Widgets

submit your site

http://smallseotools.com/google-pagerank-checker

Sonicrun

Google Search

Popular Posts

Tutorials, IT and Design

Blog Archive

Recent Posts

About Metro