Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

RPM Package Manager tips

Expert Oracle Tips by Burleson Consulting

March 22, 2012

Linux and RPM

The Redhat Package Manager is a GPL open source packaging system that allows the performance of installation, un-installation, upgrades, verification and querying of the packages. Those are the five basic operations that can be performed; the user?s package can also be built with RPM. Find the RPM package from diverse sources like Redhat?s CD and DVD, https://rhn.redhat.com/, http://rpm.org/ and http://rpmfind.net/linux/RPM/. All the options from the RPM command can be found by doing rpm --help or man rpm. A description of the most frequently used commands is given in the next few lines.

RPM querying command:

 

rpm ?q <your package name or part of it >

 

or:

 

rpm ?qa | grep ?i <your package name or part of it>

 

With the package make-3.81-103.1:

 

linux-mlpb:~ # rpm  -q make

make-3.81-103.1

 

or:

 

linux-mlpb:~ # rpm -qa | grep -i make

make-3.81-103.1

automake-1.10.1-25.1

 

RPM installation command:

 

rpm ?ivh <your package name>

 

The option i is for installation, v is for verbose and h is for printing 50 hash marks as the package archive is unpacked.

 

RPM un-installation command:

 

rpm ?e <your package name>

 

The option e stands for erase and removes the package given as an argument.

 

RPM upgrade command:

 

rpm ?Uvh <your package name>

 

The option U is for upgrade, v is for verbose and h is for printing 50 hash marks as the package archive is unpacked. Note that the option -U allows for performing the upgrade by uninstalling the previous version and it does not remove any configuration files. This option must be used to upgrade the kernel as it cannot be removed.

 

RPM Verification command:

1.      To verify which package contains the file name:

rpm ?Vf < file name to verify >

 

2.      To verify all installed packages on the system:

rpm ?Va

 

3.      To verify an installed package:

 rpm ?Vp <your package name>

 

In Chapter 6, Preparing Linux for Oracle, the necessary packages to be installed in order to perform a successful oracle installation will be covered.

 

% Exam Advice: Be capable of giving all the options for RPM and also the usage of each option as it might be a part of the exam.

Note:  When using the rpm command, especially for the installation, upgrade and uninstallation, the DBA must be root.

Software Requirements and RPM Package Manager

The quick installation guide contains a long list of software requirementsthat must be met before Oracle is installed.   Thankfully, many of these will already be present on most Linux systems.

While each and every prerequisite will not be introduced here, these examples should give a good idea of how to examine the installed software and add what is needed to meet the prerequisites.  The requirements vary by Linux distro and version so be sure to look at the right list in the documentation.

Check for packagesusing the RPM package manager command rpm.  The -q option is used to query for a given package and the name of the package, with version information removed, is passed as an argument.

# rpm -q binutils
 
binutils-2.17.50.0.6-9.el5
 
# rpm -q compat-libstdc++-33
 
compat-libstdc++-33-3.2.3-61
 

# rpm -q elfutils-libelf
 
elfutils-libelf-0.137-3.el5
 
# rpm -q elfutils-libelf-devel
 
package elfutils-libelf-devel is not installed
...

The example above shows some packages that were found (binutils, compat-libstdc++-33, elfutils-libelf) and others that were not (elfutils-libelf-devel.).  When a package is found, the version must be confirmed.  Typically, a higher version than required is acceptable but if a lower version is found, then pursue a newer version of that package.

It can sometimes be difficult to identify the correct name to query for using rpm.  An alternate way to check for installed software is to add 'a' to the options to list all installed packages, then use the beginning of the package name with the * wildcard to display entries beginning with a certain string.  This example shows this method when looking for packages beginning with 'compat'.

# rpm -qa compat*
 
compat-libstdc++-33-3.2.3-61

compat-libgcc-296-2.96-138
compat-libstdc++-296-2.96-138

Often, required packages are available on the media that was used to install Linux.  If the media is inserted, then cd into the /media directory and the disk should appear in an ls listing.  Change directory into the disk and then into the Server subdirectory of the disk and a series of rpm files will be seen.

If the required packages are not available on the install media, they can be found online.  The Linux vendor's website is a good place to start.

To install a missing package, use the rpm commandwith the options -ihv which will install, display a hash to indicate progress, and give verbose output.  The following example shows how to add the required package elfutils-libelf-devel-0.125.  While installed packages can generally be viewed by any user, the DBA needs to be root to install, update or remove packages.

# cd /media/Enterprise\ Linux\ dvd\ 20090127/Server
# ls elfutils*

 
elfutils-0.137-3.el5.i386.rpm               elfutils-libelf-devel-0.137-.el5.i386.rpm
elfutils-devel-0.137-3.el5.i386.rpm         elfutils-libelf-devel-static-.137-3.el5.i386.rpm
elfutils-devel-static-0.137-3.el5.i386.rpm  elfutils-libs-0.137-.el5.i386.rpm
elfutils-libelf-0.137-3.el5.i386.rpm

In the Server directory of the CD, there are several rpm files starting with elfutils.  Only the file elfutils-libelf-devel-0.137-3.e15.i386.rpm matches the package name, and since it is of a later version, this one is installed using rpm.

# rpm -ihv elfutils-libelf-devel-0.137-3.el5.i386.rpm

warning: elfutils-libelf-devel-0.137-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
      elfutils-libelf-devel-static-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-0.137-3.el5.i386

When attempting an installation, rpm identifies a missing prerequisite for this package.  It would appear that the choice is to install the prerequisite before this package, but an attempt to install the prerequisite fails.

# rpm -ihv elfutils-libelf-devel-static-0.137-3.el5.i386.rpm

warning: elfutils-libelf-devel-static-0.137-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
error: Failed dependencies:
      elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by elfutils-libelf-devel-static-0.137-3.el5.i386

Since these packages are dependent on each other, they need to be installed at the same time.  This can be done by listing them both after the same rpm command.

# rpm -ihv elfutils-libelf-devel-0.137-3.el5.i386.rpm elfutils-libelf-devel-static-0.137-
3.el5.i386.rpm
 

warning: elfutils-libelf-devel-0.137-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:elfutils-libelf-devel-s########################################### [ 50%]
   2:elfutils-libelf-devel  ########################################### [100%]

Both packages are now installed.  Dependencies like these are common and can typically be resolved with a little experimentation.

Note:  If your Linux install media came on CD, look on multiple CDs to find all the required packages.

If you have an older installation of Linux, you may find that you need to upgrade an installed package.  To use rpm to update rather than install, download the new package file and use the U option instead of  I when calling rpm.  If a package needs to be removed for some reason, the e option is used.

 

As DBAs, we frequently need to add or update software on our Linux servers to meet the requirements of Oracle, third party software, and developers.

Linux provides several ways to manage your software, from the fairly automatic RPM Package Manager to the more manual process of compiling software from source code.  Which method you use typically depends on how the software you need to install is distributed.

The RPM Package Manager

Formerly known as the Red Hat Package Manager, the RPM Package Manager (RPM)is used to install and manage software distributed in RPM packages.  This is the most common way Linux software is distributed, so it is important to become familiar with the RPM.

Note: The abbreviation RPM can be used to refer to the RPM Package Manager or a file containing software in the RPM format.  When referring to software, typically the name of the software is mentioned as well, like 'the RPM for the GCC compiler'.

The RPM Package Manager maintains an inventory of software it has installed on the system.  The inventory does not include software installed by other means.

The main command for the RPM Package Manager is rpm.  The rpm commandcan query the inventory and install, modify or delete software depending on the options and arguments given.  Any user can query the RPM inventory, but modifications are typically done by root.

Examining What is Currently Installed

By calling rpm with the -q option, the database of software installed via RPM can be queried.  There are several options that can be used with -q to specify what to query.  Here are some of the most useful ones.

# rpm -qa

busybox-1.2.0-4.el5
cracklib-dicts-2.8.9-3.3
rmt-0.4b41-2.fc6
dump-0.4b41-2.fc6
words-3.0-9.1
gnome-audio-2.0.0-3.1.1
glibc-2.5-34
...
 
The -qa optionsgenerate a complete list of the software currently installed through RPM.  This can be used to get a snapshot of what packages are installed at a certain time.  This output can also be used in conjunction with the sort and diff commands to compare multiple systems.

The output from rpm -qa is usually quite long.  If you want to look for a specific package, use -q and the package name.

$ rpm -q gcc
 
gcc-4.1.2-44.el5
 
This gives more succinct output about the specific package. However, if you are not sure of the exact package name, use a wildcard to fill in the blanks.  The -a option must be used when using a wildcard.

# rpm -qa gcc*
 
gcc-4.1.2-44.el5
gcc-c++-4.1.2-44.el5

Now information about packages starting with gcc can be seen.   Wildcards can be
used to fill in missing characters in the middle of a package name as well.

# rpm -qa g*c
 
glibc-2.5-34
gcc-4.1.2-44.el5
gjdoc-0.7.7-12.el5
 
By default, rpm prints the name of the software, its version and its release number separated by dashes.  This format can be confusing for packages whose names contain numbers.  For this reason, or to display additional data, the output format can be altered using the --queryformat option.

# rpm -qa --queryformat '%{NAME}\t%{VERSION}\n'
 

busybox 1.2.0
cracklib-dicts   2.8.9
rmt     0.4b41
dump    0.4b41
words   3.0
gnome-audio  2.0.0
glibc   2.5
...
 
The output format is specified in single-quotes following the --queryformat option.  This example inserts a tab character, indicated by the \t, between the name and version and a newline, indicated by \n at the end of each entry.  If the newline was not included, all the packages would be printed on a single line.

Additional text can be included in the rpm output as in this example:

# rpm -qa --queryformat '%{NAME}\t%{VERSION}\t%{RELEASE} installed on

%{INSTALLTIME:date}\n'
busybox        1.2.0     4.el5 installed on Mon 18 May 2009 01:30:31 PM EDT
cracklib-dicts 2.8.9     3.3 installed on Mon 18 May 2009 01:30:54 PM EDT
rmt   0.4b41    2.fc6 installed on Mon 18 May 2009 01:30:56 PM EDT
dump  0.4b41    2.fc6 installed on Mon 18 May 2009 01:30:56 PM EDT
words 3.0       9.1 installed on Mon 18 May 2009 01:31:01 PM EDT
gnome-audio    2.0.0     3.1.1 installed on Mon 18 May 2009 01:31:01 PM EDT
glibc 2.5       34 installed on Mon 18 May 2009 01:31:03 PM EDT
...
 
A full list of fields that can be queried for using rpm is available by running rpm with the -querytags option, but it is quite a long list.  For most purposes, you should only be interested in the NAME, VERSION, RELEASE and INSTALLTIME:date tags.  To be sure you are looking at exactly the right software package, it is important to consider both the VERSION and RELEASE tags.

Installing and Updating Software with RPM

The first step to installing an RPM is to acquire one.  A lot of common software is included in the Server subdirectory on the Linux install disks.  Other software may be available online from your Linux vendor, from the folks who make the software or from a download site.

RPM packagesare distributed as files with names in the format of software_name-version-release.platform.rpm.  When looking for RPM software packages, it is important that the name, version and release match specified requirements and the platform is correct.  The platform should match the output of the command uname -i.

Once a package that needs to be installed is acquired, it can be added using the -i option for rpm.  It is additionally common to add the '?h option to provide a hash to indicate progress and the v option to give verbose output.  Position yourself in the directory that the RPM file is in, execute rpm -ihv and give the file name.

Preparing...                ########################################### [100%]
   1:zsh                    ########################################### [100%]

If the RPM has no dependencies, the software is now installed and ready to use, but often RPM packages are dependent on other RPM packages and display an error if those packages are not already installed.  In these cases, track down the dependency before installing this software.

Under some circumstances, two RPM packages can be codependent on one another and need to be installed at the same time.  To do that, it is necessary to name both RPM files to be installed in the same command.

# rpm -ihv elfutils-libelf-devel-0.137-3.el5.i386.rpm elfutils-libelf-devel-static-0.137-3.el5.i386.rpm

warning: elfutils-libelf-devel-0.137-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 1e5e0159
Preparing...                ########################################### [100%]
   1:elfutils-libelf-devel-s########################################### [ 50%]
   2:elfutils-libelf-devel  ########################################### [100%]

Both packages are now installed.  Dependencies like these are common and can typically be resolved with a little experimentation. If you are trying to update software already installed on the system, use the U option instead of i.  The procedure is exactly the same.

Removing Software with the RPM

To remove software installed using RPM, use the -e option.  Only the software name needs to be given and no feedback is displayed on screen.

# rpm -e zsh

The software that has been removed can be confirmed by querying the RPM database.

# rpm -q zsh

package zsh is not installed

If the software to be removed is needed by other software, rpm reports an error such as the following:

# rpm -e elfutils-libelf-devel

error: Failed dependencies:
      elfutils-libelf-devel-i386 = 0.137-3.el5 is needed by (installed) elfutils-libelf-devel-static-0.137-3.el5.i386

Like with installation, either remove the dependent software first or remove codependencies together.

 

 

 
 
 
Get the Complete Details on
Linux System Management for Oracle DBAs  


The landmark book "Linux for the Oracle DBA: The Definitive Reference" provides comprehensive yet specific knowledge on administering Oracle on Linux.   A must-have reference for every DBA running or planning to run Oracle on a Linux platform.

Buy it for 30% off directly from the publisher.
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright ? 1996 -  2014

All rights reserved by Burleson

Oracle ? is the registered trademark of Oracle Corporation.


 

��  
 
 

 
 
 
 
oracle dba poster
 

 
 
Oracle performance tuning software 
 
Oracle Linux poster